MCPcopy Create free account
hub / github.com/Pometry/Raphtory / assert_has_metadata

Function assert_has_metadata

python/test_utils/utils.py:239–247  ·  view source on GitHub ↗
(entity, props)

Source from the content-addressed store, hash-verified

237
238
239def assert_has_metadata(entity, props):
240 for k, v in props.items():
241 actual = entity.metadata.get(k)
242 # Convert PyArrow arrays and other array-like objects to lists for comparison
243 if hasattr(actual, "to_pylist"):
244 actual = actual.to_pylist()
245 elif hasattr(actual, "tolist"):
246 actual = actual.tolist()
247 assert actual == v, f"Expected metadata {k!r} to be {v!r}, but got {actual!r}"
248
249
250def expect_unify_error(fn):

Callers 8

test_add_metadataFunction · 0.90
test_update_metadataFunction · 0.90
test_add_nodesFunction · 0.90
test_add_edgesFunction · 0.90
test_add_metadataFunction · 0.90
test_update_metadataFunction · 0.90
test_add_metadataFunction · 0.90
test_update_metadataFunction · 0.90

Calls 2

itemsMethod · 0.45
getMethod · 0.45

Tested by 8

test_add_metadataFunction · 0.72
test_update_metadataFunction · 0.72
test_add_nodesFunction · 0.72
test_add_edgesFunction · 0.72
test_add_metadataFunction · 0.72
test_update_metadataFunction · 0.72
test_add_metadataFunction · 0.72
test_update_metadataFunction · 0.72