From 28fb6eb0a245573b17bca4a547ab3444ba9b5e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <henrik@trineo.org> Date: Thu, 15 Jul 2021 16:47:12 +0200 Subject: [PATCH] fix --- unittests/test_structure_mapping.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/unittests/test_structure_mapping.py b/unittests/test_structure_mapping.py index ca474588..62f8ff4a 100644 --- a/unittests/test_structure_mapping.py +++ b/unittests/test_structure_mapping.py @@ -44,7 +44,6 @@ class structureMappingTest(unittest.TestCase): self.assertEqual(val, tar) def test_collect_existing_structure(self): - # Henrik: please do not overwrite defautl names; e.g. use `emap` emap = EntityMapping() reca1 = db.Record(name="Animals", id=100) reca2 = db.Record(name="Dogs", id=200) @@ -111,11 +110,11 @@ class structureMappingTest(unittest.TestCase): collect_existing_structure(recd1, recc1, emap2) # Test the correct assignment of the properties - self.assertTrue(recc2 is emap.to_existing[recd2._cuid]) - self.assertTrue(recc3 is emap.to_existing[recd3._cuid]) + self.assertTrue(recc2 is emap2.to_existing[recd2._cuid]) + self.assertTrue(recc3 is emap2.to_existing[recd3._cuid]) - self.assertTrue(recd2 is emap.to_target[recc2.id]) - self.assertTrue(recd3 is emap.to_target[recc3.id]) + self.assertTrue(recd2 is emap2.to_target[recc2.id]) + self.assertTrue(recd3 is emap2.to_target[recc3.id]) """ Test, if the Record `Cars` in `target_structure` have one additional Property """ # Test existing structure @@ -123,7 +122,7 @@ class structureMappingTest(unittest.TestCase): self.assertEqual(len(recd2.get_properties()), 2) # number of properties stay unchanged for prop_record, prop_em in zip(recc2.get_properties(), recd2.get_properties()): - self.assertTrue(prop_record is emap.to_existing[prop_em._cuid]) + self.assertTrue(prop_record is emap2.to_existing[prop_em._cuid]) # Test target structure self.assertEqual(len(recc3.get_properties()), 2) # number of properties stay unchanged -- GitLab