Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Improvement of vocabulary-tests needed? #8

@ghost

Description

The tests for vocabularies provided here:

def test_vocabularies(rdm):
"""Test queries to vocabularies."""
with pytest.raises(httpx.HTTPStatusError):
rdm.query.vocabulary("invalid_voc")
res = rdm.query.vocabulary(VocType.resource_types)
assert res.hits.total == 33
lcs = rdm.query.vocabulary(VocType.licenses)
assert lcs.hits.total == 418
sjs = rdm.query.vocabulary(VocType.subjects)
assert sjs.hits.total == 48
lgs = rdm.query.vocabulary(VocType.languages)
assert lgs.hits.total == 7847
assert rdm.query.vocabulary(VocType.languages, tags="extinct").hits.total == 619
lg = rdm.query.vocabulary(VocType.licenses, suggest="gli")
assert lg.hits.total == 1
assert lg.hits.hits[0].id == "glide"
with pytest.raises(httpx.HTTPStatusError):
rdm.query.term("license", "invalid_license")
gl = rdm.query.term(VocType.licenses, "glide")
assert gl.id == "glide"

are only working on instances where the vocabularies aren't adjusted. For example, a freshly installed instance.

It is expected and wanted behaviour that vocabularies are adapted and changed: https://inveniordm.docs.cern.ch/customize/vocabularies/
Our instance, for example, has already some other subjects and we are working on different record-types.

I wonder whether the current tests need more improvement or whether we want to limit these tests down to a 'untouched' vocabularies folder and we expect the user to disable or adjust these tests for their own instances.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions