aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichal Jagiello <michal.jagiello@t-mobile.pl>2022-06-27 12:59:33 +0000
committerMichal Jagiello <michal.jagiello@t-mobile.pl>2022-06-28 08:21:07 +0000
commit04e8c7658c0ed31a334cf64fcfd4aa5f1962b39d (patch)
treed015899d69ad3cf178fb737c9e7794265cd2bfd7 /tests
parent0565394ecbd96730bf982909693514ab88703708 (diff)
[Data provider] Add relationships between some A&AI resources0.6.0
Create relationship between: Tenant <-> Line of business Tenant <-> Owning entity Cloud region <-> Project Issue-ID: INT-2126 Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl> Change-Id: I3523c02b28b5fe972c0fbba112c8ffa532feadb8
Diffstat (limited to 'tests')
-rw-r--r--tests/test_cloud_region_resource.py11
1 files changed, 6 insertions, 5 deletions
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()