From 8ea884a3470239c0bfcd3d95127adba7080453e2 Mon Sep 17 00:00:00 2001 From: Daniel Ratiu Date: Fri, 5 Jan 2024 21:03:04 +0100 Subject: [PATCH] py: fixed test --- mps-cli-py/tests/test_nodes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mps-cli-py/tests/test_nodes.py b/mps-cli-py/tests/test_nodes.py index e08314c..5c6f141 100644 --- a/mps-cli-py/tests/test_nodes.py +++ b/mps-cli-py/tests/test_nodes.py @@ -39,7 +39,9 @@ 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] @@ -47,6 +49,8 @@ def test_build_nodes(self, test_data_location, library_top_library_top_model_nam 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() \ No newline at end of file