Skip to content

Commit

Permalink
#223: Add test cases for the bug fixed in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed May 17, 2021
1 parent 9021fc8 commit f16cb15
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions test/db/endpoints/test_get_with_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ def test_valid_get_with_filters_multiple_distinct(
[{"title": "Title for DataGateway API Testing (DB) 0"}],
id="Single unrelated distinct field",
),
pytest.param(
'"investigationInstruments.createTime"',
[
{
"investigationInstruments": {
"createTime": DateHandler.datetime_object_to_str(
Constants.TEST_MOD_CREATE_DATETIME,
),
},
},
],
id="Single related distinct field",
),
pytest.param(
'["createTime", "investigationInstruments.createTime"]',
[
Expand All @@ -68,7 +81,21 @@ def test_valid_get_with_filters_multiple_distinct(
},
},
],
id="List containing related distinct field",
id="Single related distinct field with unrelated field",
),
pytest.param(
'["investigationInstruments.createTime", "facility.id"]',
[
{
"facility": {"id": 1},
"investigationInstruments": {
"createTime": DateHandler.datetime_object_to_str(
Constants.TEST_MOD_CREATE_DATETIME,
),
},
},
],
id="Multiple related distinct fields",
),
pytest.param(
'["createTime", "investigationInstruments.createTime", "facility.id"]',
Expand All @@ -85,7 +112,7 @@ def test_valid_get_with_filters_multiple_distinct(
},
},
],
id="Multiple related distinct fields",
id="Multiple related distinct fields with unrelated field",
),
],
)
Expand Down

0 comments on commit f16cb15

Please sign in to comment.