From: fengyuanxing Date: Thu, 7 Sep 2017 02:52:07 +0000 (+0800) Subject: Rename the testcase to solve conflict X-Git-Tag: v1.0.0~64 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F75%2F10675%2F1;p=vfc%2Fnfvo%2Fcatalog.git Rename the testcase to solve conflict Change-Id: I0f0fda1880e02b93a3f8f1165baabdf4ffb980bf Issue-Id: VFC-264 Signed-off-by: fengyuanxing --- diff --git a/catalog/packages/tests.py b/catalog/packages/tests.py index 97d4dc34..04387d59 100644 --- a/catalog/packages/tests.py +++ b/catalog/packages/tests.py @@ -578,14 +578,22 @@ class PackageTest(unittest.TestCase): self.assertEquals(size, len(vnfdmodels)) - def test_nf_package_parser(self): - reqdata={"csarId":"1"} - #response = self.client.post("/api/catalog/v1/parservnfd",reqdata) - #self.assertEqual(status.HTTP_202_ACCEPTED, response.status_code, response.content) + @mock.patch.object(NfDistributeThread, 'get_vnfd') + def test_nf_package_parser(self, mock_get_vnfd): + # First distribute a VNF + template_file_name = "resource-TestFyx-template.yml" + local_file_name = os.path.join(os.path.dirname(__file__), template_file_name) + vnfd = json.JSONEncoder().encode(self.vnfd_json) + mock_get_vnfd.return_value = self.vnfd_json,local_file_name,vnfd + NfDistributeThread(str(self.nf_csarId), ["1"], "1", "4").run() + self.assert_nfmodel_result(str(self.nf_csarId), 1) + reqdata={"csarId":"456"} + #response = self.client.post("/api/catalog/v1/parservnfd",reqdata) + #self.assertEqual(status.HTTP_202_ACCEPTED, response.status_code, response.content) @mock.patch.object(NfDistributeThread, 'get_vnfd') @mock.patch.object(NsPackage,'get_nsd') - def test_ns_distribute(self, mock_get_nsd,mock_get_vnfd): + def test_ns_package_parser(self, mock_get_nsd,mock_get_vnfd): # First distribute a VNF template_file_name = "resource-TestFyx-template.yml" local_file_name = os.path.join(os.path.dirname(__file__), template_file_name)