-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#150: Add findone tests for DB backend
- This commit also includes a fixes a bug found on the 404 of that test class
- Loading branch information
1 parent
8c1941d
commit 3eec346
Showing
3 changed files
with
31 additions
and
2 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
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,25 @@ | ||
class TestDBFindone: | ||
def test_valid_findone_with_filters( | ||
self, | ||
flask_test_app_db, | ||
valid_db_credentials_header, | ||
single_investigation_test_data_db, | ||
): | ||
test_response = flask_test_app_db.get( | ||
'/investigations/findone?where={"TITLE": {"like": "Title for DataGateway' | ||
' API Testing (DB)"}}', | ||
headers=valid_db_credentials_header, | ||
) | ||
|
||
assert test_response.json == single_investigation_test_data_db.to_dict() | ||
|
||
def test_valid_no_results_findone_with_filters( | ||
self, flask_test_app_db, valid_db_credentials_header, | ||
): | ||
test_response = flask_test_app_db.get( | ||
'/investigations/findone?where={"TITLE": {"eq": "This filter should cause a' | ||
'404 for testing purposes..."}}', | ||
headers=valid_db_credentials_header, | ||
) | ||
|
||
assert test_response.status_code == 404 |
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