Skip to content

Commit

Permalink
Added read method as a smoke test utility
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaruland committed Jan 11, 2024
1 parent 33a78e2 commit 56e021b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tiled/client/smoke.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
def read(node, faulty_docs=[], verbose=False):
if node.structure_family == "container":
for key, child_node in node.items():
fault_result = read(child_node)
if len(fault_result) > 0:
faulty_docs.append(fault_result)
else:
try:
if verbose:
print(f"reading node with data: {node.item['id']}")
tmp = node.read() # noqa: F841
except Exception:
if verbose:
print(
f"Node {node.item['id']} does not have a read method or data is fault"
)
faulty_docs.append(node.uri)
return faulty_docs

return faulty_docs

0 comments on commit 56e021b

Please sign in to comment.