developmentseed / titiler-image

TiTiler extension to work with non-geo images
MIT License
18 stars 4 forks source link

add tests #2

Closed vincentsarago closed 1 year ago

vincentsarago commented 1 year ago

FYI: here is the result of the IIIF validation script

$ cd tests/fixtures && uvicorn titiler.image.main:app --reload --port 8080

$ pip install iiif-validator
$ iiif-validate.py -i 67352ccc-d1b0-11e1-89ae-279075081939 -s 127.0.0.1:8080 --scheme http --version 3.0 --prefix iiif
Importing 3
[1] test baseurl_redirect PASS
[2] test cors PASS
[3] test format_error_random FAIL
  url: ['http://127.0.0.1:8080/iiif/67352ccc-d1b0-11e1-89ae-279075081939/full/max/0/default.=:@']
  got: 422
  expected: [400, 415, 503]
  type: status
  message: 
  Is Warning?: False
[4] test format_jpg PASS
[5] test id_basic PASS
[6] test id_error_escapedslash PASS
[7] test id_error_random PASS
[8] test id_error_unescaped PASS
[9] test id_escaped PASS
[10] test id_squares PASS
[11] test info_json PASS
[12] test jsonld FAIL
  url: []
  got: False
  expected: 1
  type: json-ld
  message: Content-Type to start with application/ld+json
  Is Warning?: False
[13] test quality_error_random FAIL
  url: ['http://127.0.0.1:8080/iiif/67352ccc-d1b0-11e1-89ae-279075081939/full/max/0/jIrq>o.jpg']
  got: 422
  expected: 400
  type: status
  message: 
  Is Warning?: False
[14] test region_error_random PASS
[15] test region_pixels PASS
[16] test region_square PASS
[17] test rot_error_random PASS
[18] test size_ch PASS
[19] test size_error_random PASS
[20] test size_nofull PASS
[21] test size_noup PASS
[22] test size_region PASS
[23] test size_wc PASS
[24] test size_wh PASS
Done (24 tests, 3 failures)

2 failures can be considered OK IMO because they come from FastAPI/Pydantic directly when trying to use parameters outside the restricted enums for format or quality

The json-ld error will be solved later