Skip to content
Snippets Groups Projects
Commit 28fb6eb0 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

fix

parent a35e52d8
No related branches found
No related tags found
1 merge request!8F h5 cfood
This commit is part of merge request !8. Comments created here will be created in the context of that merge request.
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment