Skip to content

Commit 6414a03

Browse files
committed
Including get_all test for parent references.
1 parent 312784e commit 6414a03

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

integration_tests/test_inventory.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,13 @@ def test_parent_references(live_c8y: CumulocityApi, asset_hierarchy_root_id, chi
262262
# each child as an 'addition' child
263263
assert len(result.child_additions) == 1
264264

265+
# using get_all
266+
result2 = live_c8y.inventory.get_all(name=child.name, with_children=True, with_parents=True)
267+
assert len(result2) == 1
268+
parents2 = result2[0].__dict__[f'parent_{child_type}s']
269+
assert parents[0].id == parents2[0].id
270+
assert parents[0].name == parents2[0].name
271+
265272

266273
def test_deletion(live_c8y: CumulocityApi, safe_create):
267274
"""Verify that deletion works as expected.

0 commit comments

Comments
 (0)