Skip to content

Commit

Permalink
fix mypy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
msaipraneeth committed Dec 14, 2023
1 parent 6c33fbb commit 8a6c1e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions cmem_plugin_base/dataintegration/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def __eq__(self, other):
and self.is_uri == other.is_uri
and self.is_attribute == other.is_attribute)


class EntitySchema:
"""An entity schema.
Expand Down
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 @@ -14,7 +14,7 @@ def test_single_object():
}"""
data = json.loads(test_data)
entities = build_entities_from_data(data)
assert len(entities.entities) == 1
assert len(list(entities.entities)) == 1
for _ in entities.entities:
assert len(_.values) == 2
assert _.values == [["sai"], ["[email protected]"]]
Expand All @@ -29,7 +29,7 @@ def test_single_object():


def test_single_object_one_level():
"""test write to single object"""
"""test write to single object with one level"""
test_data = """
{
"name": "sai",
Expand All @@ -41,7 +41,7 @@ def test_single_object_one_level():
}"""
data = json.loads(test_data)
entities = build_entities_from_data(data)
assert len(entities.entities) == 1
assert len(list(entities.entities)) == 1
for _ in entities.entities:
assert len(_.values) == 3
assert _.values[0:2] == [["sai"], ["[email protected]"]]
Expand All @@ -68,8 +68,9 @@ def test_single_object_one_level():
]
)


def test_single_object_one_level_array():
"""test write to single object"""
"""test write to single object with array in first level"""
test_data = """
{
"name": "sai",
Expand All @@ -85,7 +86,7 @@ def test_single_object_one_level_array():
}"""
data = json.loads(test_data)
entities = build_entities_from_data(data)
assert len(entities.entities) == 1
assert len(list(entities.entities)) == 1
for _ in entities.entities:
assert len(_.values) == 3
assert _.values[0:2] == [["sai"], ["[email protected]"]]
Expand All @@ -111,4 +112,3 @@ def test_single_object_one_level_array():
EntityPath("country", False, is_attribute=True)
]
)

0 comments on commit 8a6c1e9

Please sign in to comment.