aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_aai_owning_entity.py
diff options
context:
space:
mode:
authorKiran <kiran.mhetre@t-systems.com>2023-10-03 10:46:29 +0530
committerKiran <kiran.mhetre@t-systems.com>2023-10-05 19:44:33 +0530
commit9676519775c5cac40791fa02071301dbb7974c59 (patch)
tree33b67d4d947f293cf3ea04a6300e1fb2eb5f8971 /tests/test_aai_owning_entity.py
parent7f61bdf95398b461581a2b0aec043faa24c94ee2 (diff)
updated changes for delete functionality for entities and relationship between entities.
Issue-ID: TEST-407 Change-Id: Ie8abaee76af001260ae999d3e56e886b8f449517 Signed-off-by: Kiran <kiran.mhetre@t-systems.com>
Diffstat (limited to 'tests/test_aai_owning_entity.py')
-rw-r--r--tests/test_aai_owning_entity.py41
1 files changed, 26 insertions, 15 deletions
diff --git a/tests/test_aai_owning_entity.py b/tests/test_aai_owning_entity.py
index 0f16044..dce8986 100644
--- a/tests/test_aai_owning_entity.py
+++ b/tests/test_aai_owning_entity.py
@@ -18,32 +18,30 @@ import pytest
from onapsdk.aai.business import OwningEntity
from onapsdk.exceptions import ResourceNotFound
-
OWNING_ENTITIES = {
- "owning-entity":[
+ "owning-entity": [
{
- "owning-entity-id":"ff6c945f-89ab-4f14-bafd-0cdd6eac791a",
- "owning-entity-name":"OE-Generic",
- "resource-version":"1588244348931",
+ "owning-entity-id": "ff6c945f-89ab-4f14-bafd-0cdd6eac791a",
+ "owning-entity-name": "OE-Generic",
+ "resource-version": "1588244348931",
},
{
- "owning-entity-id":"OE-generic",
- "owning-entity-name":"OE-generic",
- "resource-version":"1587388597761"
+ "owning-entity-id": "OE-generic",
+ "owning-entity-name": "OE-generic",
+ "resource-version": "1587388597761"
},
{
- "owning-entity-id":"b3dcdbb0-edae-4384-b91e-2f114472520c"
- ,"owning-entity-name":"test",
- "resource-version":"1588145971158"
+ "owning-entity-id": "b3dcdbb0-edae-4384-b91e-2f114472520c"
+ , "owning-entity-name": "test",
+ "resource-version": "1588145971158"
}
]
}
-
OWNING_ENTITY = {
- "owning-entity-id":"OE-generic",
- "owning-entity-name":"OE-generic",
- "resource-version":"1587388597761"
+ "owning-entity-id": "OE-generic",
+ "owning-entity-name": "OE-generic",
+ "resource-version": "1587388597761"
}
@@ -85,3 +83,16 @@ def test_owning_entity_create(mock_send_json, mock_send):
)
assert owning_entity.owning_entity_id == "OE-generic"
assert owning_entity.name == "OE-generic"
+
+
+@mock.patch.object(OwningEntity, "send_message")
+def test_owning_entity_delete(mock_send_message):
+ owning_entity = OwningEntity(name="test_owning_entity",
+ owning_entity_id="test_owning_id",
+ resource_version="12345")
+ owning_entity.delete()
+ mock_send_message.assert_called_once_with(
+ "DELETE",
+ "Delete owning entity",
+ f"{owning_entity.url}?resource-version={owning_entity.resource_version}"
+ )