Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomomarchioro committed Dec 17, 2024
1 parent 207bf9c commit 554b30e
Show file tree
Hide file tree
Showing 2 changed files with 185 additions and 191 deletions.
20 changes: 6 additions & 14 deletions tests/integration/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ def printdiff(dict_1, dict_2):
"""
for diff in list(dictdiffer.diff(dict_1, dict_2)):
print(diff)

import geojson


except ImportError:
# pip install dictdiffer
def printdiff(x,y):
print("To show the differences install `dictdiffer`")
pass
# unittest.util._MAX_LENGTH=500000
# python -m unittest tests.py -v
Expand Down Expand Up @@ -264,15 +267,13 @@ def test_0013_placeholderCanvas(self):
Test 0013-placeholderCanvas
"""
ref, json_manifest = get_files("0013-placeholderCanvas")
printdiff(ref, json_manifest)
self.assertEqual(ordered(ref), ordered(json_manifest))

def test_0021_tagging(self):
"""
0021-tagging
"""
ref, json_manifest = get_files("0021-tagging")
printdiff(ref, json_manifest)
self.assertEqual(ordered(ref), ordered(json_manifest))

def test_0024_book_4_toc(self):
Expand All @@ -287,7 +288,6 @@ def test_0026_toc_opera(self):
0026-toc-opera
"""
ref, json_manifest = get_files("0026-toc-opera")
# printdiff(ref,json_manifest)
self.assertEqual(ordered(ref), ordered(json_manifest))

def test_0033_choice(self):
Expand All @@ -309,15 +309,13 @@ def test_0053_seeAlso(self):
0053-seeAlso
"""
ref, json_manifest = get_files("0053-seeAlso")
# printdiff(ref,json_manifest)
self.assertEqual(ordered(ref), ordered(json_manifest))

def test_0065_opera_multiple_canvases(self):
"""
0065-opera-multiple-canvases
"""
ref, json_manifest = get_files("0065-opera-multiple-canvases")
# printdiff(ref,json_manifest)
self.assertEqual(ordered(ref), ordered(json_manifest))

def test_0117_add_image_thumbnail(self):
Expand All @@ -335,8 +333,9 @@ def test_0139_geolocate_canvas_fragment(self):
"http://iiif.io/api/presentation/3/context.json",
"http://geojson.org/geojson-ld/geojson-context.jsonld",
]
ref, json_manifest = get_files("0139-geolocate-canvas-fragment",
context=contexts)
ref, json_manifest = get_files(
"0139-geolocate-canvas-fragment", context=contexts
)
self.assertEqual(ordered(ref), ordered(json_manifest))

def test_0154_geo_extension(self):
Expand All @@ -348,7 +347,6 @@ def test_0154_geo_extension(self):
"http://iiif.io/api/presentation/3/context.json",
]
ref, json_manifest = get_files("0154-geo-extension", context=context)
printdiff(ref, json_manifest)
self.assertEqual(ordered(ref), ordered(json_manifest))

def test_0202_start_canvas(self):
Expand Down Expand Up @@ -391,15 +389,13 @@ def test_0266_full_canvas_annotation(self):
0266-full-canvas-annotation
"""
ref, json_manifest = get_files("0266-full-canvas-annotation")
printdiff(ref, json_manifest)
self.assertEqual(ordered(ref), ordered(json_manifest))

def test_0261_non_rectangular_commenting(self):
"""
0261-non-rectangular-commenting
"""
ref, json_manifest = get_files("0261-non-rectangular-commenting")
printdiff(ref, json_manifest)
self.assertEqual(ordered(ref), ordered(json_manifest))

def test_0269_embedded_or_referenced_annotations(self):
Expand Down Expand Up @@ -531,7 +527,6 @@ def test_0013_placeholderCanvas(self):
Test 0013-placeholderCanvas
"""
ref, json_manifest = get_files2("0013-placeholderCanvas")
printdiff(ref, json_manifest)
self.assertEqual(ordered(ref), ordered(json_manifest))

def test_0230_navdate_navdate_map_2(self):
Expand Down Expand Up @@ -581,23 +576,20 @@ def test_0053_seeAlso(self):
0053-seeAlso
"""
ref, json_manifest = get_files2("0053-seeAlso")
# printdiff(ref,json_manifest)
self.assertEqual(ordered(ref), ordered(json_manifest))

def test_0065_opera_multiple_canvases(self):
"""
0065-opera-multiple-canvases
"""
ref, json_manifest = get_files2("0065-opera-multiple-canvases")
# printdiff(ref,json_manifest)
self.assertEqual(ordered(ref), ordered(json_manifest))

def test_0026_toc_opera(self):
"""
0026-toc-opera
"""
ref, json_manifest = get_files2("0026-toc-opera")
# printdiff(ref,json_manifest)
self.assertEqual(ordered(ref), ordered(json_manifest))

def test_0266_full_canvas_annotation(self):
Expand Down
Loading

0 comments on commit 554b30e

Please sign in to comment.