From 246df561b466d1202a40ece1c133a4bf70ab958f Mon Sep 17 00:00:00 2001 From: dengyh Date: Wed, 29 Jul 2020 17:03:15 +0800 Subject: Unity MSB address Change-Id: Ie1ded953213ed156ff7a1f4d884851ddd93c18e5 Issue-ID: MODELING-405 Signed-off-by: dengyh --- catalog/packages/tests/test_nsdm_subscription.py | 35 ++++++------------------ 1 file changed, 8 insertions(+), 27 deletions(-) (limited to 'catalog/packages/tests/test_nsdm_subscription.py') diff --git a/catalog/packages/tests/test_nsdm_subscription.py b/catalog/packages/tests/test_nsdm_subscription.py index b992b2d..61c8ce6 100644 --- a/catalog/packages/tests/test_nsdm_subscription.py +++ b/catalog/packages/tests/test_nsdm_subscription.py @@ -29,7 +29,7 @@ from catalog.pub.config import config as pub_config import catalog.pub.utils.timeutil from catalog.packages.tests.const import nsd_data from catalog.pub.database.models import NSPackageModel, VnfPackageModel, PnfPackageModel -from catalog.pub.config.config import CATALOG_ROOT_PATH, MSB_SERVICE_IP, MSB_SERVICE_PORT +from catalog.pub.config.config import CATALOG_ROOT_PATH, MSB_BASE_URL from catalog.pub.utils import toscaparser @@ -180,8 +180,7 @@ class TestNsdmSubscription(TestCase): response = self.client.post("/api/nsd/v1/subscriptions", data=self.subscription, format='json') self.assertEqual(303, response.status_code) - redirect_addr = "https://%s:%s/%s" % (MSB_SERVICE_IP, MSB_SERVICE_PORT, - os.path.join(const.NSDM_SUBSCRIPTION_ROOT_URI, subscriptionid)) + redirect_addr = "%s/%s" % (MSB_BASE_URL, os.path.join(const.NSDM_SUBSCRIPTION_ROOT_URI, subscriptionid)) self.assertEqual(redirect_addr, response["Location"]) @mock.patch("requests.get") @@ -627,15 +626,9 @@ class TestNsdmSubscription(TestCase): 'nsdId': "b632bddc-bccd-4180-bd8d-4e8a9578eff7", '_links': { 'nsdInfo': { - 'href': 'http://%s:%s/%s/ns_descriptors/%s' % (pub_config.MSB_SERVICE_IP, - pub_config.MSB_SERVICE_PORT, - const.NSD_URL_PREFIX, - "d0ea5ec3-0b98-438a-9bea-488230cff174")}, + 'href': '%s/%s/ns_descriptors/%s' % (pub_config.MSB_BASE_URL, const.NSD_URL_PREFIX, "d0ea5ec3-0b98-438a-9bea-488230cff174")}, 'subscription': { - 'href': 'http://%s:%s/%s%s' % (pub_config.MSB_SERVICE_IP, - pub_config.MSB_SERVICE_PORT, - const.NSDM_SUBSCRIPTION_ROOT_URI, - "1111")} + 'href': '%s/%s%s' % (pub_config.MSB_BASE_URL, const.NSDM_SUBSCRIPTION_ROOT_URI, "1111")} }, "subscriptionId": "1111" @@ -682,16 +675,10 @@ class NotificationTest(TestCase): 'nsdId': "nsdid1", '_links': { 'nsdInfo': { - 'href': 'http://%s:%s/%s/ns_descriptors/%s' % (pub_config.MSB_SERVICE_IP, - pub_config.MSB_SERVICE_PORT, - const.NSD_URL_PREFIX, - "nsdinfoid1") + 'href': '%s/%s/ns_descriptors/%s' % (pub_config.MSB_BASE_URL, const.NSD_URL_PREFIX, "nsdinfoid1") }, 'subscription': { - 'href': 'http://%s:%s/%s%s' % (pub_config.MSB_SERVICE_IP, - pub_config.MSB_SERVICE_PORT, - const.NSDM_SUBSCRIPTION_ROOT_URI, - "1")} + 'href': '%s/%s%s' % (pub_config.MSB_BASE_URL, const.NSDM_SUBSCRIPTION_ROOT_URI, "1")} }, 'onboardingFailureDetails': "NSD(nsdid1) already exists.", "subscriptionId": "1" @@ -724,16 +711,10 @@ class NotificationTest(TestCase): 'pnfdId': "pnfdId1", '_links': { 'pnfdInfo': { - 'href': 'http://%s:%s/%s/pnf_descriptors/%s' % (pub_config.MSB_SERVICE_IP, - pub_config.MSB_SERVICE_PORT, - const.NSD_URL_PREFIX, - "pnfdInfoIds1") + 'href': '%s/%s/pnf_descriptors/%s' % (pub_config.MSB_BASE_URL, const.NSD_URL_PREFIX, "pnfdInfoIds1") }, 'subscription': { - 'href': 'http://%s:%s/%s%s' % (pub_config.MSB_SERVICE_IP, - pub_config.MSB_SERVICE_PORT, - const.NSDM_SUBSCRIPTION_ROOT_URI, - "1")}, + 'href': '%s/%s%s' % (pub_config.MSB_BASE_URL, const.NSDM_SUBSCRIPTION_ROOT_URI, "1")}, }, "subscriptionId": "1", } -- cgit 1.2.3-korg