Skip to content

Commit

Permalink
refactor(tests): refactor test folder structure
Browse files Browse the repository at this point in the history
The main rationale for this is that parameters shouldnt be overly
modularized e.g. in order to avoid lengthy import statements.
  • Loading branch information
lu-pl committed Oct 28, 2024
1 parent 319de5a commit f5d4e5b
Show file tree
Hide file tree
Showing 13 changed files with 416 additions and 313 deletions.
11 changes: 11 additions & 0 deletions tests/data/models/dummy_model.py
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 tests/data/parameters/author_array_collection_model_parameters.py

This file was deleted.

28 changes: 0 additions & 28 deletions tests/data/parameters/author_work_title_model_parameters.py

This file was deleted.

49 changes: 0 additions & 49 deletions tests/data/parameters/basic_model_parameters.py

This file was deleted.

94 changes: 94 additions & 0 deletions tests/data/parameters/count_query_parameters.py
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,
),
]
42 changes: 0 additions & 42 deletions tests/data/parameters/grouping_model_parameters.py

This file was deleted.

Loading

0 comments on commit f5d4e5b

Please sign in to comment.