Skip to content

Commit

Permalink
test: use external IIIF link in test data (DEV-4340) (#1265)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum authored Nov 11, 2024
1 parent dbbaefe commit c9516fa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/dsp_tools/utils/uri_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def is_iiif_uri(uri: str) -> bool:
r"^((\^|%5e)?max|" # max | ^max
r"(\^|%5e)?full|" # full | ^full
r"(\^|%5e)?pct:\d+(\.\d+)?|" # pct:n | ^pct:n
r"(\^|%5e)?(\d+(\.\d+)?)+,|" # w, | ^w,
r"(\^|%5e)?(\d+(\.\d+)?)+(,|%2c)|" # w, | ^w,
r"(\^|%5e)?,\d+(\.\d+)?|" # ,h | ^,h
r"(\^|%5e)?!?\d+(\.\d+)?,\d+(\.\d+)?)$" # w,h | ^w,h | !w,h | ^!w,h
)
Expand Down
1 change: 1 addition & 0 deletions test/unittests/utils/test_uri_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"https://www.example.org/prefix1/prefix2/prefix3/prefix4/abcd1234/full/%5Emax/0/gray.webp",
"https://iiif.dasch.swiss/0811/1Oi7mdiLsG7-FmFgp0xz2xU.jp2/full/max/0/default.jpg",
"http://www.example.org/prefix1/prefix2/prefix3/abcd1234/80,15,60,75/full/0/native",
"https://iiif.wellcomecollection.org/image/b20432033_B0008608.JP2/full/1338%2C/0/default.jpg",
],
)
def test_is_iiif_uri_correct(uri: str) -> None:
Expand Down
7 changes: 5 additions & 2 deletions testdata/xml-data/test-data-systematic.xml
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,12 @@
restype=":ImageThing"
id="iiif-link"
permissions="open">
<iiif-uri>https://iiif.dasch.swiss/0811/1Oi7mdiLsG7-FmFgp0xz2xU.jp2/full/837,530/0/default.jp2</iiif-uri>
<iiif-uri>https://iiif.wellcomecollection.org/image/b20432033_B0008608.JP2/full/1338%2C/0/default.jpg</iiif-uri>
<text-prop name=":hasSimpleText">
<text permissions="open" encoding="utf8">This is a IIIFImageThing</text>
<text permissions="open" encoding="utf8">
Licence: Attribution-NonCommercial 4.0 International (CC BY-NC 4.0).
Credit: Zebrafish embryo. Source: Wellcome Collection.
</text>
</text-prop>
</resource>

Expand Down

0 comments on commit c9516fa

Please sign in to comment.