summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordyh <dengyuanhong@chinamobile.com>2020-02-19 15:26:33 +0800
committerdyh <dengyuanhong@chinamobile.com>2020-02-19 15:26:49 +0800
commita8aae3166f06b86a609182b671d0e9a6ae314b44 (patch)
treef75dcf1b44637b74ce9ac321a59db6940db194ac
parent36fa4d4ccf968236872e6d86c0a279ff0d9eb552 (diff)
update test cases if subscription does not exist
Change-Id: I933c66c735482d2c8fc112f8d88c0a5c9e208300 Issue-ID: MODELING-313 Signed-off-by: dyh <dengyuanhong@chinamobile.com>
-rw-r--r--catalog/packages/tests/test_vnf_pkg_subscription.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/catalog/packages/tests/test_vnf_pkg_subscription.py b/catalog/packages/tests/test_vnf_pkg_subscription.py
index d2e2b5b..fd229ec 100644
--- a/catalog/packages/tests/test_vnf_pkg_subscription.py
+++ b/catalog/packages/tests/test_vnf_pkg_subscription.py
@@ -148,20 +148,16 @@ class TestNfPackageSubscription(TestCase):
self.assertEqual(temp_uuid, response.data["id"])
@mock.patch("requests.get")
- @mock.patch.object(uuid, 'uuid4')
- def test_get_subscription_with_id_not_exists(self, mock_uuid4, mock_requests):
- temp_uuid = "99442b18-a5c7-11e8-998c-bf1755941f13"
- dummy_uuid = str(uuid.uuid4())
+ def test_get_subscription_with_id_not_exists(self, mock_requests):
mock_requests.return_value.status_code = 204
mock_requests.get.status_code = 204
- mock_uuid4.return_value = temp_uuid
self.client.post(
"/api/vnfpkgm/v1/subscriptions",
data=self.vnf_subscription_data,
format='json'
)
response = self.client.get(
- "/api/vnfpkgm/v1/subscriptions/%s" % dummy_uuid,
+ "/api/vnfpkgm/v1/subscriptions/111",
format='json'
)
self.assertEqual(404, response.status_code)
@@ -186,9 +182,7 @@ class TestNfPackageSubscription(TestCase):
response = self.client.delete("/api/vnfpkgm/v1/subscriptions/%s" % temp_uuid)
self.assertEqual(204, response.status_code)
- @mock.patch("requests.get")
- @mock.patch.object(uuid, 'uuid4')
- def test_delete_subscription_with_id_not_exists(self, mock_uuid4, mock_requests):
+ def test_delete_subscription_with_id_not_exists(self):
dummy_uuid = str(uuid.uuid4())
response = self.client.delete("/api/vnfpkgm/v1/subscriptions/%s" % dummy_uuid)
self.assertEqual(404, response.status_code)