DTS validator is a suite of tests to validate implementations of the DTS API. The tests are implemented with pytest and the pytest-html plugin is used to generate an HTML report of the performed tests. For now, only JSON validation (against JSON schemas) is implemented; JSON-LD validation (against SHACL shapes) will be added later on.
NB: DTS Validator supports version unstable of the specs; it is currently up-to-date with commit ef8c7cdaf789b61a1b7949fe42b1f168982a102a of the DTS specs repo.
pip install https://github.com/mromanello/DTS-validator/archive/refs/heads/main.zip
# to check that everything works
dts-validator --help
# to run the default tests
dts-validator --html=dts_validation_report.htmlShow more
git clone https://github.com/mromanello/DTS-validator.git
cd DTS-validator/
# if you don’t have poetry installed, uncomment the line below
# pip install poetry
poetry install
poetry shell
make testor you can also run tests for selected endpoints (can be convenient during development):
make test--entry
make test-collection
make test-navigationShow more
Use the --entry-endpoint parameter to provide the URI of the API to be validated:
dts-validator --entry-endpoint=https://dev.dracor.org/api/v1/dtsAdditionally, an HTML test report can be output; just provide the path of the HTML file:
dts-validator --entry-endpoint=https://dev.dracor.org/api/v1/dts --html=report.htmlFor a more verbose report, change the --log-level to DEBUG:
dts-validator --entry-endpoint=https://dev.dracor.org/api/v1/dts --html=report.html --log-cli-level=debugIf no --entry-endpoint is provided, a series of mock tests will be executed:
dts-validator --html=report.htmlFor more examples, see the commands contained in the Makefile.
Show more
See the examples in notebook example_dts_client.ipynb.
| Name | API entry endpoint | DTS version | Validation status |
|---|---|---|---|
| DraCor | https://staging.dracor.org/api/v1/dts | unstable |
|
| UBHD | https://digi.ub.uni-heidelberg.de/editionService/dts/ | unstable |
|
| DoTS demo | https://dots.chartes.psl.eu/demo/api/dts/ | 1-alpha |