diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_aai_resource.py | 4 | ||||
-rw-r--r-- | tests/test_cds.py | 4 | ||||
-rw-r--r-- | tests/test_gui.py | 6 | ||||
-rw-r--r-- | tests/test_sdc_element.py | 4 | ||||
-rw-r--r-- | tests/test_sdnc_element.py | 4 | ||||
-rw-r--r-- | tests/test_so_element.py | 4 | ||||
-rw-r--r-- | tests/test_vsp.py | 13 |
7 files changed, 13 insertions, 26 deletions
diff --git a/tests/test_aai_resource.py b/tests/test_aai_resource.py index c1da0b7..afdecb6 100644 --- a/tests/test_aai_resource.py +++ b/tests/test_aai_resource.py @@ -56,5 +56,5 @@ def test_get_guis(send_message_mock): send_message_mock.return_value.url = "https://aai.api.sparky.simpledemo.onap.org:30220/services/aai/webapp/index.html#/browse" gui_results = component.get_guis() assert type(gui_results) == GuiList - assert gui_results.guilist[0].url == send_message_mock.return_value.url - assert gui_results.guilist[0].status == send_message_mock.return_value.status_code + assert gui_results.guis[0].url == send_message_mock.return_value.url + assert gui_results.guis[0].status == send_message_mock.return_value.status_code diff --git a/tests/test_cds.py b/tests/test_cds.py index 5244552..50da7f2 100644 --- a/tests/test_cds.py +++ b/tests/test_cds.py @@ -351,8 +351,8 @@ def test_get_guis(send_message_mock): send_message_mock.return_value.url = "http://portal.api.simpledemo.onap.org:30449/" gui_results = component.get_guis() assert type(gui_results) == GuiList - assert gui_results.guilist[0].url == send_message_mock.return_value.url - assert gui_results.guilist[0].status == send_message_mock.return_value.status_code + assert gui_results.guis[0].url == send_message_mock.return_value.url + assert gui_results.guis[0].status == send_message_mock.return_value.status_code @patch.object(ResolvedTemplate, "send_message_json") diff --git a/tests/test_gui.py b/tests/test_gui.py index 06b2a28..622e77b 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -43,9 +43,9 @@ class GuiTestingBase(unittest.TestCase): test = GuiList([]) test.add(gui1) test.add(gui2) - assert len(test.guilist) == 2 - assert test.guilist[0].status == 184 - assert test.guilist[1].url == 'url2' + assert len(test.guis) == 2 + assert test.guis[0].status == 184 + assert test.guis[1].url == 'url2' def test_add_bad_gui_item(self): with self.assertRaises(AttributeError): diff --git a/tests/test_sdc_element.py b/tests/test_sdc_element.py index 8cfb907..14ec3fa 100644 --- a/tests/test_sdc_element.py +++ b/tests/test_sdc_element.py @@ -83,8 +83,8 @@ def test_get_guis(send_message_mock): send_message_mock.return_value.url = "https://sdc.api.fe.simpledemo.onap.org:30207/sdc1/portal" gui_results = SDC.get_guis() assert type(gui_results) == GuiList - assert gui_results.guilist[0].url == send_message_mock.return_value.url - assert gui_results.guilist[0].status == send_message_mock.return_value.status_code + assert gui_results.guis[0].url == send_message_mock.return_value.url + assert gui_results.guis[0].status == send_message_mock.return_value.status_code @mock.patch.object(SDC, "get_all") @mock.patch.object(Vsp, "created") diff --git a/tests/test_sdnc_element.py b/tests/test_sdnc_element.py index 6c8fe2d..6d730df 100644 --- a/tests/test_sdnc_element.py +++ b/tests/test_sdnc_element.py @@ -22,5 +22,5 @@ def test_get_guis(send_message_mock): component = SdncElement() gui_results = component.get_guis() assert type(gui_results) == GuiList - assert len(gui_results.guilist) == 2 - # assert gui_results.guilist[0].status == send_message_mock.return_value.status_code + assert len(gui_results.guis) == 2 + # assert gui_results.guis[0].status == send_message_mock.return_value.status_code diff --git a/tests/test_so_element.py b/tests/test_so_element.py index cc866d9..55c0c33 100644 --- a/tests/test_so_element.py +++ b/tests/test_so_element.py @@ -24,5 +24,5 @@ def test_get_guis(send_message_mock): send_message_mock.return_value.url = "http://so.api.simpledemo.onap.org:30277/" gui_results = component.get_guis() assert type(gui_results) == GuiList - assert gui_results.guilist[0].url == send_message_mock.return_value.url - assert gui_results.guilist[0].status == send_message_mock.return_value.status_code + assert gui_results.guis[0].url == send_message_mock.return_value.url + assert gui_results.guis[0].status == send_message_mock.return_value.status_code diff --git a/tests/test_vsp.py b/tests/test_vsp.py index fa374fa..7f427a1 100644 --- a/tests/test_vsp.py +++ b/tests/test_vsp.py @@ -485,19 +485,6 @@ def test_upload_not_OK(mock_send, mock_status): @mock.patch.object(Vsp, 'load_status') @mock.patch.object(Vsp, 'send_message') -def test_upload_error_in_response(mock_send, mock_status): - """Don't update status if submission NOK.""" - vsp = Vsp() - vsp._status = const.DRAFT - mock_send.return_value = mock.MagicMock(text='{"status": "Failure"}') - vsp._version = "1234" - vsp._identifier = "12345" - with pytest.raises(APIError): - vsp.upload_package('data') - mock_send.assert_called_once_with('POST', 'upload ZIP for Vsp', "https://sdc.api.fe.simpledemo.onap.org:30207/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products/12345/versions/1234/orchestration-template-candidate", files={'upload': 'data'}, headers={'Accept': 'application/json', 'USER_ID': 'cs0008', 'Authorization': 'Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=', 'X-ECOMP-InstanceID': 'onapsdk', 'Accept-Encoding': 'gzip, deflate'}) - -@mock.patch.object(Vsp, 'load_status') -@mock.patch.object(Vsp, 'send_message') def test_upload_OK(mock_send, mock_status): """Don't update status if submission NOK.""" vsp = Vsp() |