-
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 invalid tests for ISIS specific endpoints
- Loading branch information
1 parent
861b4f8
commit 1470b22
Showing
2 changed files
with
87 additions
and
12 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,87 @@ | ||
class TestTableEndpoints: | ||
""" | ||
This class tests the endpoints defined in table_endpoints.py, commonly referred to | ||
as the ISIS specific endpoints | ||
""" | ||
|
||
def test_valid_get_facility_cycles_with_filters(self): | ||
pass | ||
|
||
def test_invalid_get_facility_cycles_with_filters( | ||
self, flask_test_app, valid_credentials_header, | ||
): | ||
final_instrument_result = flask_test_app.get( | ||
'/instruments/findone?order="id DESC"', headers=valid_credentials_header, | ||
) | ||
final_instrument_id = final_instrument_result.json["id"] | ||
|
||
test_response = flask_test_app.get( | ||
f"/instruments/{final_instrument_id + 100}/facilitycycles", | ||
headers=valid_credentials_header, | ||
) | ||
|
||
assert test_response.status_code == 404 | ||
|
||
def test_valid_get_facility_cycles_count_with_filters(self): | ||
pass | ||
|
||
def test_invalid_get_facility_cycles_count_with_filters( | ||
self, flask_test_app, valid_credentials_header, | ||
): | ||
final_instrument_result = flask_test_app.get( | ||
'/instruments/findone?order="id DESC"', headers=valid_credentials_header, | ||
) | ||
final_instrument_id = final_instrument_result.json["id"] | ||
|
||
test_response = flask_test_app.get( | ||
f"/instruments/{final_instrument_id + 100}/facilitycycles/count", | ||
headers=valid_credentials_header, | ||
) | ||
|
||
assert test_response.json == 0 | ||
|
||
def test_valid_get_investigations_with_filters(self): | ||
pass | ||
|
||
def test_invalid_get_investigations_with_filters( | ||
self, flask_test_app, valid_credentials_header, | ||
): | ||
final_instrument_result = flask_test_app.get( | ||
'/instruments/findone?order="id DESC"', headers=valid_credentials_header, | ||
) | ||
final_instrument_id = final_instrument_result.json["id"] | ||
final_facilitycycle_result = flask_test_app.get( | ||
'/facilitycycles/findone?order="id DESC"', headers=valid_credentials_header, | ||
) | ||
final_facilitycycle_id = final_facilitycycle_result.json["id"] | ||
|
||
test_response = flask_test_app.get( | ||
f"/instruments/{final_instrument_id + 100}/facilitycycles/" | ||
f"{final_facilitycycle_id + 100}/investigations", | ||
headers=valid_credentials_header, | ||
) | ||
|
||
assert test_response.status_code == 404 | ||
|
||
def test_valid_get_investigations_count_with_filters(self): | ||
pass | ||
|
||
def test_invalid_get_investigations_count_with_filters( | ||
self, flask_test_app, valid_credentials_header, | ||
): | ||
final_instrument_result = flask_test_app.get( | ||
'/instruments/findone?order="id DESC"', headers=valid_credentials_header, | ||
) | ||
final_instrument_id = final_instrument_result.json["id"] | ||
final_facilitycycle_result = flask_test_app.get( | ||
'/facilitycycles/findone?order="id DESC"', headers=valid_credentials_header, | ||
) | ||
final_facilitycycle_id = final_facilitycycle_result.json["id"] | ||
|
||
test_response = flask_test_app.get( | ||
f"/instruments/{final_instrument_id + 100}/facilitycycles/" | ||
f"{final_facilitycycle_id + 100}/investigations/count", | ||
headers=valid_credentials_header, | ||
) | ||
|
||
assert test_response.json == 0 |
This file was deleted.
Oops, something went wrong.