Skip to content

Commit

Permalink
compare object instead of comparing string representations
Browse files Browse the repository at this point in the history
  • Loading branch information
msaipraneeth committed Dec 14, 2023
1 parent 5624ea0 commit b3b2db7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_utils_build_entities_from_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ def test_single_object():
assert len(_.values) == 2
assert _.values == [["sai"], ["[email protected]"]]
assert len(entities.schema.paths) == 2
assert str(entities.schema) == str(EntitySchema(
assert entities.schema == EntitySchema(
type_uri="",
paths=[
EntityPath("name", False, is_attribute=True),
EntityPath("email", False, is_attribute=True),
]
))
)


def test_single_object_one_level():
Expand All @@ -47,23 +47,23 @@ def test_single_object_one_level():
assert _.values[0:2] == [["sai"], ["[email protected]"]]
assert _.values[2][0].startswith("urn:x-ulid:")
assert len(entities.schema.paths) == 3
assert str(entities.schema) == str(EntitySchema(
assert entities.schema == EntitySchema(
type_uri="",
paths=[
EntityPath("name", False, is_attribute=True),
EntityPath("email", False, is_attribute=True),
EntityPath("city", True, is_attribute=True),
]
))
)
# Validate sub entities
for _ in entities.sub_entities:
for _entity in _.entities:
assert len(_entity.values) == 2
assert _entity.values == [["San Francisco"], ["United States"]]
assert str(_.schema) == str(EntitySchema(
assert _.schema == EntitySchema(
type_uri="",
paths=[
EntityPath("name", False, is_attribute=True),
EntityPath("country", False, is_attribute=True)
]
))
)

0 comments on commit b3b2db7

Please sign in to comment.