-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests and add delete data type endpoint
- Loading branch information
Showing
4 changed files
with
62 additions
and
11 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
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,23 @@ | ||
import os | ||
import json | ||
|
||
def test_get_spectra_layouts_with_data(client): | ||
data_type_json_path = './tests/fixtures/test_data_types.json' | ||
response = client.get('/spectra_layouts') | ||
response_data = response.json() | ||
assert response.status_code == 200 | ||
assert response_data == { | ||
"NMRSPECTRUM": "NMR", | ||
"INFRARED SPECTRUM": "INFRARED" | ||
} | ||
|
||
def test_get_spectra_layouts_without_data(client): | ||
data_type_json_path = './tests/fixtures/result/spectralayout_test_data.json' | ||
|
||
response = client.get('/spectra_layouts') | ||
response_data = response.json() | ||
assert response.status_code == 200 | ||
assert response_data == {} | ||
|
||
if os.path.exists(data_type_json_path): | ||
os.remove(data_type_json_path) |
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