Skip to content

Commit

Permalink
py: fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
ratiud committed Jan 5, 2024
1 parent e9938bf commit 8ea884a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mps-cli-py/tests/test_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@ def test_build_nodes(self, test_data_location, library_top_library_top_model_nam
self.doSetUp(test_data_location)
library_top_library_top = self.repo.find_model_by_name(library_top_library_top_model_name)

root_node = library_top_library_top.root_nodes[0]
root_nodes=library_top_library_top.root_nodes
root_nodes.sort(key=get_name)
root_node = root_nodes[0]
self.assertEqual("munich_library", root_node.get_property("name"))

tom_sawyer = root_node.get_children("entities")[0]
self.assertEqual("Tom Sawyer", tom_sawyer.get_property("name"))
author_of_tom_sawyer = tom_sawyer.get_children("authors")[0].get_reference("person").resolve(self.repo)
self.assertEqual("Mark Twain", author_of_tom_sawyer.get_property("name"))

def get_name(node):
return node.get_property("name")

if __name__ == '__main__':
unittest.main()

0 comments on commit 8ea884a

Please sign in to comment.