Skip to content

Commit

Permalink
Fix execution tests
Browse files Browse the repository at this point in the history
Don't rely on database ids in execution test assertions.

Re #2431
  • Loading branch information
soininen committed Jan 11, 2024
1 parent 5694d48 commit b20e441
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions execution_tests/simple_importer_on_server/execution_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def test_execution(self):
# Check that DS1.sqlite is empty
with DatabaseMapping(self._db_url) as db_map:
entities = db_map.get_items("entity")
print(entities)
self.assertEqual(0, len(entities))
completed = subprocess.run(
(
Expand All @@ -66,16 +65,7 @@ def test_execution(self):
# Check that entities are now in DB
with DatabaseMapping(self._db_url) as db_map:
entities = db_map.get_items("entity")
self.assertEqual(3, len(entities))
for entity in entities:
if entity["id"] == 1:
self.assertEqual("Factory1", entity["name"])
elif entity["id"] == 2:
self.assertEqual("Factory2", entity["name"])
elif entity["id"] == 3:
self.assertEqual("Factory3", entity["name"])
else:
self.fail()
self.assertCountEqual([entity["name"] for entity in entities], ["Factory1", "Factory2", "Factory3"])


if __name__ == '__main__':
Expand Down

0 comments on commit b20e441

Please sign in to comment.