From 04e8c7658c0ed31a334cf64fcfd4aa5f1962b39d Mon Sep 17 00:00:00 2001 From: Michal Jagiello Date: Mon, 27 Jun 2022 12:59:33 +0000 Subject: [Data provider] Add relationships between some A&AI resources Create relationship between: Tenant <-> Line of business Tenant <-> Owning entity Cloud region <-> Project Issue-ID: INT-2126 Signed-off-by: Michal Jagiello Change-Id: I3523c02b28b5fe972c0fbba112c8ffa532feadb8 --- tests/test_cloud_region_resource.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/test_cloud_region_resource.py') diff --git a/tests/test_cloud_region_resource.py b/tests/test_cloud_region_resource.py index b704720..303e1c3 100644 --- a/tests/test_cloud_region_resource.py +++ b/tests/test_cloud_region_resource.py @@ -80,21 +80,22 @@ def test_cloud_region_create(mock_cloud_region_create, mock_exists): "onap_data_provider.resources.cloud_region_resource.CloudRegionResource.cloud_region", new_callable=PropertyMock, ) -@patch("onap_data_provider.resources.cloud_region_resource.Complex.get_all") +@patch("onap_data_provider.resources.cloud_region_resource.Complex.get_by_physical_location_id") def test_cloud_region_resource_link_to_complex( - mock_complex_get_all, mock_cloud_region_property + mock_complex_get_by_physical_location_id, mock_cloud_region_property ): mock_cloud_region_property.return_value.complex = MagicMock() cloud_region_resource = CloudRegionResource(CLOUD_REGION_DATA) cloud_region_resource._link_to_complex("test") - mock_complex_get_all.assert_not_called() + mock_complex_get_by_physical_location_id.assert_not_called() mock_cloud_region_property.return_value.complex = None - mock_complex_get_all.return_value = iter(()) + mock_complex_get_by_physical_location_id.side_effect = ResourceNotFound cloud_region_resource._link_to_complex("test") mock_cloud_region_property.return_value.link_to_complex.assert_not_called() - mock_complex_get_all.return_value = iter([Complex("test")]) + mock_complex_get_by_physical_location_id.side_effect = None + mock_complex_get_by_physical_location_id.return_value = Complex("test") cloud_region_resource._link_to_complex("test") mock_cloud_region_property.return_value.link_to_complex.assert_called_once() -- cgit 1.2.3-korg