Skip to content

Commit

Permalink
test: add more PaNOSC hop test cases #260
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed Dec 21, 2021
1 parent b256eaf commit 40320f2
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion test/search_api/filters/test_search_api_where_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,32 @@ class TestSearchAPIWhereFilter:
" '%Keyword%'",
id="WHERE filter on ICAT related entity with 0-many relationship",
),
# TODO - add in the rest of the PaNOSC hops
pytest.param(
SearchAPIWhereFilter("samples.description", "Test description", "like"),
"Dataset",
"SELECT o FROM Dataset o JOIN o.sample AS s1 JOIN s1.parameters AS s2"
" JOIN s2.type AS s3 WHERE s3.description like '%Test description%'",
id="WHERE filter on ICAT related entity with a PaNOSC hop",
),
pytest.param(
SearchAPIWhereFilter("datasets.files.name", "Test filename", "like"),
"Document",
"SELECT o FROM Investigation o JOIN o.datasets AS s1 JOIN s1.datafiles"
" AS s2 WHERE s2.name like '%Test filename%'",
id="WHERE filter on ICAT related entity with two PaNOSC hops",
),
pytest.param(
SearchAPIWhereFilter(
"instrument.datasets.parameters.unit", "Dataset parameter", "eq",
),
"Dataset",
"SELECT o FROM Dataset o JOIN o.investigation AS i JOIN"
" i.investigationInstruments AS s1 JOIN s1.instrument AS s2 JOIN"
" s2.investigationInstruments AS s3 JOIN s3.investigation AS s4 JOIN"
" s4.datasets AS s5 JOIN s5.parameters AS s6 JOIN s6.type AS s7 WHERE"
" s7.units = 'Dataset parameter'",
id="WHERE filter on ICAT related entity with three PaNOSC hops",
),
pytest.param(
SearchAPIWhereFilter("parameters.value", "My Parameter", "eq"),
"Document",
Expand Down

0 comments on commit 40320f2

Please sign in to comment.