Skip to content

Commit 8ecba6d

Browse files
committed
Improve test coverage
1 parent 1c6fc94 commit 8ecba6d

2 files changed

Lines changed: 617 additions & 3 deletions

File tree

terminusdb_client/schema/schema.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def _check_cycling(class_obj: "TerminusClass"):
8585
if hasattr(class_obj, "_subdocument"):
8686
mro_names = [obj.__name__ for obj in class_obj.__mro__]
8787
for prop_type in class_obj._annotations.values():
88-
if str(prop_type) in mro_names:
88+
if prop_type.__name__ in mro_names:
8989
raise RecursionError(f"Embbding {prop_type} cause recursions.")
9090

9191

@@ -100,8 +100,8 @@ def _check_mismatch_type(prop, prop_value, prop_type):
100100
else:
101101
if prop_type is int:
102102
prop_value = int(prop_value)
103-
# TODO: This is now broken
104-
# check_type(prop, prop_value, prop_type)
103+
check_type(prop, prop_value, prop_type)
104+
return prop_value
105105

106106

107107
def _check_missing_prop(doc_obj: "DocumentTemplate"):

0 commit comments

Comments
 (0)