Skip to content
Snippets Groups Projects

F h5 cfood

Merged Henrik tom Wörden requested to merge f-h5-cfood into dev
1 file
+ 5
6
Compare changes
  • Side-by-side
  • Inline
@@ -44,7 +44,6 @@ class structureMappingTest(unittest.TestCase):
@@ -44,7 +44,6 @@ class structureMappingTest(unittest.TestCase):
self.assertEqual(val, tar)
self.assertEqual(val, tar)
def test_collect_existing_structure(self):
def test_collect_existing_structure(self):
# Henrik: please do not overwrite defautl names; e.g. use `emap`
emap = EntityMapping()
emap = EntityMapping()
reca1 = db.Record(name="Animals", id=100)
reca1 = db.Record(name="Animals", id=100)
reca2 = db.Record(name="Dogs", id=200)
reca2 = db.Record(name="Dogs", id=200)
@@ -111,11 +110,11 @@ class structureMappingTest(unittest.TestCase):
@@ -111,11 +110,11 @@ class structureMappingTest(unittest.TestCase):
collect_existing_structure(recd1, recc1, emap2)
collect_existing_structure(recd1, recc1, emap2)
# Test the correct assignment of the properties
# Test the correct assignment of the properties
self.assertTrue(recc2 is emap.to_existing[recd2._cuid])
self.assertTrue(recc2 is emap2.to_existing[recd2._cuid])
self.assertTrue(recc3 is emap.to_existing[recd3._cuid])
self.assertTrue(recc3 is emap2.to_existing[recd3._cuid])
self.assertTrue(recd2 is emap.to_target[recc2.id])
self.assertTrue(recd2 is emap2.to_target[recc2.id])
self.assertTrue(recd3 is emap.to_target[recc3.id])
self.assertTrue(recd3 is emap2.to_target[recc3.id])
""" Test, if the Record `Cars` in `target_structure` have one additional Property """
""" Test, if the Record `Cars` in `target_structure` have one additional Property """
# Test existing structure
# Test existing structure
@@ -123,7 +122,7 @@ class structureMappingTest(unittest.TestCase):
@@ -123,7 +122,7 @@ class structureMappingTest(unittest.TestCase):
self.assertEqual(len(recd2.get_properties()), 2) # number of properties stay unchanged
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()):
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
# Test target structure
self.assertEqual(len(recc3.get_properties()), 2) # number of properties stay unchanged
self.assertEqual(len(recc3.get_properties()), 2) # number of properties stay unchanged
Loading