-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(tests): refactor test folder structure
This branch implements a restructuring of the test suite. Rationale: Over-modularization of test parameter definitions clutters up the test suite and leads to lengthy/repetitive import statements. For now, the structure of the test suite should only differentiate 1. unit tests and 2. all other tests. Additional test categories may be introduced at a later point. The test category should be indicated in the test module doc string. Closes #100
- Loading branch information
Showing
13 changed files
with
416 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"""Simple dummy models e.g. for count query constructor testing.""" | ||
|
||
from pydantic import BaseModel, ConfigDict | ||
|
||
|
||
class Dummy(BaseModel): | ||
pass | ||
|
||
|
||
class GroupedDummy(BaseModel): | ||
model_config = ConfigDict(group_by="x") |
87 changes: 0 additions & 87 deletions
87
tests/data/parameters/author_array_collection_model_parameters.py
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
tests/data/parameters/author_work_title_model_parameters.py
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
from tests.data.models.dummy_model import Dummy, GroupedDummy | ||
from tests.utils._types import CountQueryParameter | ||
|
||
|
||
construct_count_query_parameters = [ | ||
CountQueryParameter( | ||
query=""" | ||
select ?x ?y ?z | ||
where { | ||
values (?x ?y ?z) { | ||
(1 2 3) | ||
(1 22 33) | ||
(2 222 333) | ||
} | ||
} | ||
""", | ||
model=Dummy, | ||
expected=3, | ||
), | ||
CountQueryParameter( | ||
query=""" | ||
select ?x ?y ?z | ||
where { | ||
values (?x ?y ?z) { | ||
(1 2 3) | ||
(1 22 33) | ||
(2 222 333) | ||
} | ||
} | ||
""", | ||
model=GroupedDummy, | ||
expected=2, | ||
), | ||
CountQueryParameter( | ||
query=""" | ||
select ?x ?y ?z | ||
where { | ||
values (?x ?y ?z) { | ||
(1 2 3) | ||
(1 22 33) | ||
(1 22 33) | ||
(2 222 333) | ||
} | ||
} | ||
""", | ||
model=Dummy, | ||
expected=4, | ||
), | ||
CountQueryParameter( | ||
query=""" | ||
select ?x ?y ?z | ||
where { | ||
values (?x ?y ?z) { | ||
(1 2 3) | ||
(1 22 33) | ||
(1 22 33) | ||
(2 222 333) | ||
} | ||
} | ||
""", | ||
model=GroupedDummy, | ||
expected=2, | ||
), | ||
CountQueryParameter( | ||
query=""" | ||
select ?x ?y ?z | ||
where { | ||
values (?x ?y ?z) { | ||
(1 2 3) | ||
(1 22 33) | ||
(2 222 333) | ||
(2 222 333) | ||
} | ||
} | ||
""", | ||
model=Dummy, | ||
expected=4, | ||
), | ||
CountQueryParameter( | ||
query=""" | ||
select ?x ?y ?z | ||
where { | ||
values (?x ?y ?z) { | ||
(1 2 3) | ||
(1 22 33) | ||
(2 222 333) | ||
(2 222 333) | ||
} | ||
} | ||
""", | ||
model=GroupedDummy, | ||
expected=2, | ||
), | ||
] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.