aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_aai_complex.py
diff options
context:
space:
mode:
authorKiran <kiran.mhetre@t-systems.com>2023-10-17 19:32:38 +0530
committerKiran <kiran.mhetre@t-systems.com>2023-10-18 17:47:42 +0530
commit58a1c13883f815197c76487b382eddf2eed67207 (patch)
tree1b8f46c26fa778ceb5249b0506ad289e3a2c2c86 /tests/test_aai_complex.py
parent302843649277556deb8fb885213283f866e90ae8 (diff)
changes for update functionality for entities..
Issue-ID: TEST-412 Change-Id: I598c289f87fff80323ef979600df45d4fa4591dd Signed-off-by: Kiran <kiran.mhetre@t-systems.com>
Diffstat (limited to 'tests/test_aai_complex.py')
-rw-r--r--tests/test_aai_complex.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_aai_complex.py b/tests/test_aai_complex.py
index 8368d18..9b36426 100644
--- a/tests/test_aai_complex.py
+++ b/tests/test_aai_complex.py
@@ -77,6 +77,20 @@ def test_complex(mock_send_message):
assert url == (f"{Complex.base_url}{Complex.api_version}/cloud-infrastructure/"
"complexes/complex/test_location_id")
+@mock.patch.object(Complex, "send_message")
+def test_complex_update(mock_send_message):
+ cmplx1 = Complex.update(name="test_complex_name",
+ physical_location_id="test_location_id")
+ mock_send_message.assert_called_once()
+ assert cmplx1.name == "test_complex_name"
+ assert cmplx1.physical_location_id == "test_location_id"
+ assert cmplx1.url == (f"{Complex.base_url}{Complex.api_version}/cloud-infrastructure/"
+ "complexes/complex/test_location_id")
+ method, _, url = mock_send_message.call_args[0]
+ assert method == "PATCH"
+ assert url == (f"{Complex.base_url}{Complex.api_version}/cloud-infrastructure/"
+ "complexes/complex/test_location_id")
+
@mock.patch.object(Complex, "send_message_json")
def test_complex_get_all(mock_send_message_json):