Skip to content

Commit

Permalink
reverses changes to tests since updating TileModel.save logic #9648
Browse files Browse the repository at this point in the history
  • Loading branch information
chrabyrd committed Jul 7, 2023
1 parent 49a2d6f commit efe7769
Showing 1 changed file with 23 additions and 47 deletions.
70 changes: 23 additions & 47 deletions tests/importer/jsonld_import_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1275,57 +1275,39 @@ def get_tile_by_id(tiles, tileid):
tile1 = get_tiles_by_nodegroup(tiles, "e717dda0-1540-11ea-b353-acde48001122", "f025e108-1540-11ea-b353-acde48001122", 6)
tile1_parent = get_tile_by_id(tiles, tile1.parenttile_id)

self.assertEqual(
tile1_parent.data,
{
'c5a9174c-1540-11ea-b353-acde48001122': None,
'd155a4c0-1540-11ea-b353-acde48001122': None,
'ddc44d9c-1540-11ea-b353-acde48001122': None
}
)
self.assertEqual(tile1_parent.data, {})
tile1_grandparent = get_tile_by_id(tiles, tile1_parent.parenttile_id)
self.assertEqual(tile1_grandparent.data["02ec0ace-1541-11ea-b353-acde48001122"]["en"], {"direction": "ltr", "value": "second part"})

tile2 = get_tiles_by_nodegroup(tiles, "e717dda0-1540-11ea-b353-acde48001122", "f025e108-1540-11ea-b353-acde48001122", 1)
tile2_parent = get_tile_by_id(tiles, tile2.parenttile_id)
self.assertEqual(
tile2_parent.data,
{
'c5a9174c-1540-11ea-b353-acde48001122': None,
"d155a4c0-1540-11ea-b353-acde48001122": "2019-12-03",
"ddc44d9c-1540-11ea-b353-acde48001122": "2019-12-05"
}
tile2_parent.data, {"d155a4c0-1540-11ea-b353-acde48001122": "2019-12-03", "ddc44d9c-1540-11ea-b353-acde48001122": "2019-12-05"}
)
tile2_grandparent = get_tile_by_id(tiles, tile2_parent.parenttile_id)
self.assertEqual(tile2_grandparent.data["02ec0ace-1541-11ea-b353-acde48001122"]["en"], {"direction": "ltr", "value": "asdf"})
self.assertEqual(
tile2_grandparent.data["26927e22-1541-11ea-b353-acde48001122"][0]["resourceId"], "5e9baff0-109b-11ea-957a-acde48001122"
)
tile2_greatgrandparent = get_tile_by_id(tiles, tile2_grandparent.parenttile_id)
self.assertEqual(tile2_greatgrandparent.data, {'af6c5d36-1540-11ea-b353-acde48001122': None})
self.assertEqual(tile2_greatgrandparent.data, {})

tile1_greatgrandparent = get_tile_by_id(tiles, tile1_grandparent.parenttile_id)
self.assertEqual(tile2_greatgrandparent, tile1_greatgrandparent)

tile3 = get_tiles_by_nodegroup(tiles, "c5a9174c-1540-11ea-b353-acde48001122", "d155a4c0-1540-11ea-b353-acde48001122", "2019-12-07")
self.assertEqual(
tile3.data,
{
'c5a9174c-1540-11ea-b353-acde48001122': None,
"d155a4c0-1540-11ea-b353-acde48001122": "2019-12-07",
"ddc44d9c-1540-11ea-b353-acde48001122": "2019-12-08"
}
tile3.data, {"d155a4c0-1540-11ea-b353-acde48001122": "2019-12-07", "ddc44d9c-1540-11ea-b353-acde48001122": "2019-12-08"}
)
tile3_parent = get_tile_by_id(tiles, tile3.parenttile_id)
self.assertEqual(tile3_parent.data["02ec0ace-1541-11ea-b353-acde48001122"]["en"], {"direction": "ltr", "value": "bar"})
tile3_grandparent = get_tile_by_id(tiles, tile3_parent.parenttile_id)
self.assertEqual(tile3_grandparent.data, {'af6c5d36-1540-11ea-b353-acde48001122': None})
self.assertEqual(tile3_grandparent.data, {})

tile4 = get_tiles_by_nodegroup(tiles, "48f3ab3a-1541-11ea-b353-acde48001122")[0]
self.assertEqual(
tile4.data,
{
'48f3ab3a-1541-11ea-b353-acde48001122': None,
"54272cd4-1541-11ea-b353-acde48001122": ["d2908ab9-19a6-4a82-953d-5ebe8d164e85"],
"8e08a496-1541-11ea-b353-acde48001122": None,
},
Expand Down Expand Up @@ -1426,19 +1408,17 @@ def test_8181_import_bug(self):
actual_tiledata.append(tile.data)

expected_tiledata = [
{'f13ffd9c-3e76-11ec-9a49-faffc210b420': {'en': {'value': 'ALLAN, DAVID', 'direction': 'ltr'}}},
{"f13ffd9c-3e76-11ec-9a49-faffc210b420": {"en": {"value": "ALLAN, DAVID", "direction": "ltr"}}},
{
'f1403424-3e76-11ec-9a49-faffc210b420': None,
'f1417e1a-3e76-11ec-9a49-faffc210b420': ['b83cab06-1cfe-4aeb-9653-cb9f0cc45595'],
'f1420740-3e76-11ec-9a49-faffc210b420': None,
'f1420f92-3e76-11ec-9a49-faffc210b420': None
},
"f1420740-3e76-11ec-9a49-faffc210b420": None,
"f1420f92-3e76-11ec-9a49-faffc210b420": None,
"f1417e1a-3e76-11ec-9a49-faffc210b420": ["b83cab06-1cfe-4aeb-9653-cb9f0cc45595"],
},
{
'f1403424-3e76-11ec-9a49-faffc210b420': None,
'f1417e1a-3e76-11ec-9a49-faffc210b420': ['fc3559c4-03c4-428c-a48e-0f480c8a3751'],
'f1420740-3e76-11ec-9a49-faffc210b420': None,
'f1420f92-3e76-11ec-9a49-faffc210b420': None
}
"f1420740-3e76-11ec-9a49-faffc210b420": None,
"f1420f92-3e76-11ec-9a49-faffc210b420": None,
"f1417e1a-3e76-11ec-9a49-faffc210b420": ["fc3559c4-03c4-428c-a48e-0f480c8a3751"],
},
]
self.assertCountEqual(actual_tiledata, expected_tiledata)

Expand Down Expand Up @@ -1492,21 +1472,17 @@ def test_8181_import_bug_2(self):
actual_tiledata.append(tile.data)

expected_tiledata = [
{"f13ffd9c-3e76-11ec-9a49-faffc210b420": {"en": {"value": "ALLAN, DAVID", "direction": "ltr"}}},
{
'f1403424-3e76-11ec-9a49-faffc210b420': None,
'f1417e1a-3e76-11ec-9a49-faffc210b420': ['b83cab06-1cfe-4aeb-9653-cb9f0cc45595'],
'f1420740-3e76-11ec-9a49-faffc210b420': None,
'f1420f92-3e76-11ec-9a49-faffc210b420': None
},
{
'f1403424-3e76-11ec-9a49-faffc210b420': None,
'f1417e1a-3e76-11ec-9a49-faffc210b420': ['fc3559c4-03c4-428c-a48e-0f480c8a3751'],
'f1420740-3e76-11ec-9a49-faffc210b420': None,
'f1420f92-3e76-11ec-9a49-faffc210b420': None
},
"f1420740-3e76-11ec-9a49-faffc210b420": None,
"f1420f92-3e76-11ec-9a49-faffc210b420": None,
"f1417e1a-3e76-11ec-9a49-faffc210b420": ["b83cab06-1cfe-4aeb-9653-cb9f0cc45595"],
},
{
'f13ffd9c-3e76-11ec-9a49-faffc210b420': {'en': {'value': 'ALLAN, DAVID', 'direction': 'ltr'}}
}
"f1420740-3e76-11ec-9a49-faffc210b420": None,
"f1420f92-3e76-11ec-9a49-faffc210b420": None,
"f1417e1a-3e76-11ec-9a49-faffc210b420": ["fc3559c4-03c4-428c-a48e-0f480c8a3751"],
},
]
self.assertCountEqual(actual_tiledata, expected_tiledata)

Expand Down

0 comments on commit efe7769

Please sign in to comment.