aboutsummaryrefslogtreecommitdiffstats
path: root/catalog/packages/tests
diff options
context:
space:
mode:
authorhongyuzhao <zhao.hongyu@zte.com.cn>2020-02-20 15:18:36 +0800
committerhongyuzhao <zhao.hongyu@zte.com.cn>2020-02-20 15:25:23 +0800
commit1487db0615f16783fd01998a0f71fb2d8f97a434 (patch)
treefb2edf5a03dbec467e446f242ec0b68246a5b004 /catalog/packages/tests
parent0eaa773364c415f946860fef6f69f1fcda414178 (diff)
Fix for ETSI Catalog Manager does not support HTTPS for Test Notification Endpoint and Notification
Change-Id: I5c0133ea163b98c74fb668f2b77aaa95ec1cc3ec Issue-ID: MODELING-315 Signed-off-by: hongyuzhao <zhao.hongyu@zte.com.cn>
Diffstat (limited to 'catalog/packages/tests')
-rw-r--r--catalog/packages/tests/test_nsdm_subscription.py21
-rw-r--r--catalog/packages/tests/test_vnf_pkg_subscription.py11
2 files changed, 25 insertions, 7 deletions
diff --git a/catalog/packages/tests/test_nsdm_subscription.py b/catalog/packages/tests/test_nsdm_subscription.py
index e5e2b83..2d95a1c 100644
--- a/catalog/packages/tests/test_nsdm_subscription.py
+++ b/catalog/packages/tests/test_nsdm_subscription.py
@@ -34,7 +34,6 @@ from catalog.pub.utils import toscaparser
class TestNsdmSubscription(TestCase):
-
def setUp(self):
self.client = APIClient()
NsdmSubscriptionModel.objects.all().delete()
@@ -466,7 +465,7 @@ class TestNsdmSubscription(TestCase):
expected_data = {
"status": 404,
"detail": "Subscription(" + self.subscription_id + ") "
- "doesn't exist"
+ "doesn't exist"
}
response = self.client.get('/api/nsd/v1/'
'subscriptions/' + self.subscription_id,
@@ -625,7 +624,10 @@ class TestNsdmSubscription(TestCase):
}
mock_requests_post.assert_called_with(expect_callbackuri, data=expect_notification,
auth=HTTPBasicAuth("username", "password"),
- headers={'Connection': 'close'})
+ headers={'Connection': 'close',
+ 'content-type': 'application/json',
+ 'accept': 'application/json'},
+ verify=False)
class NotificationTest(TestCase):
@@ -676,7 +678,13 @@ class NotificationTest(TestCase):
}
}
}
- mock_requests_post.assert_called_with(expect_callbackuri, data=expect_notification, headers={'Connection': 'close'})
+ mock_requests_post.assert_called_with(expect_callbackuri,
+ data=expect_notification,
+ headers={'Connection': 'close',
+ 'content-type': 'application/json',
+ 'accept': 'application/json'},
+ verify=False
+ )
@mock.patch("requests.post")
@mock.patch("uuid.uuid4")
@@ -712,4 +720,7 @@ class NotificationTest(TestCase):
}
}
mock_requests_post.assert_called_with(expect_callbackuri, data=expect_notification,
- headers={'Connection': 'close'})
+ headers={'Connection': 'close',
+ 'content-type': 'application/json',
+ 'accept': 'application/json'},
+ verify=False)
diff --git a/catalog/packages/tests/test_vnf_pkg_subscription.py b/catalog/packages/tests/test_vnf_pkg_subscription.py
index ab90299..17de7cf 100644
--- a/catalog/packages/tests/test_vnf_pkg_subscription.py
+++ b/catalog/packages/tests/test_vnf_pkg_subscription.py
@@ -243,7 +243,11 @@ class TestNfPackageSubscription(TestCase):
}
}
mock_requests_post.assert_called_with(vnf_subscription_data["callbackUri"], data=expect_notification,
- headers={'Connection': 'close'}, auth=HTTPBasicAuth("admin", "pwd1234"))
+ headers={'Connection': 'close',
+ 'content-type': 'application/json',
+ 'accept': 'application/json'},
+ auth=HTTPBasicAuth("admin", "pwd1234"),
+ verify=False)
def test_service_query_single_subscription_not_found(self):
try:
@@ -314,4 +318,7 @@ class NotificationTest(TestCase):
}
}
mock_requests_post.assert_called_with(expect_callbackuri, data=expect_notification,
- headers={'Connection': 'close'})
+ headers={'Connection': 'close',
+ 'content-type': 'application/json',
+ 'accept': 'application/json'},
+ verify=False)