aboutsummaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/test_partial_correlations.py49
1 files changed, 44 insertions, 5 deletions
diff --git a/tests/integration/test_partial_correlations.py b/tests/integration/test_partial_correlations.py
index 17ea539..ff6d771 100644
--- a/tests/integration/test_partial_correlations.py
+++ b/tests/integration/test_partial_correlations.py
@@ -92,7 +92,6 @@ def test_partial_correlation_api_with_missing_request_data(client, post_data):
response.status_code == 400 and response.is_json and
response.json.get("status") == "error")
-
@pytest.mark.integration_test
@pytest.mark.slow
@pytest.mark.parametrize(
@@ -118,9 +117,7 @@ def test_partial_correlation_api_with_missing_request_data(client, post_data):
{"dataset": "a_dataset2", "name": "a_name2"}],
"method": "a_method",
"target_db": "a_db"
- }, {# Temp -- Fails due to missing table. Remove this sample if it is
- # confirmed that the deletion of the database table is on purpose, and
- # that Temp traits are no longer a thing
+ }, {# Temp
"primary_trait": {"dataset": "a_Temp_dataset", "name": "a_name"},
"control_traits": [
{"dataset": "a_dataset", "name": "a_name"},
@@ -128,7 +125,7 @@ def test_partial_correlation_api_with_missing_request_data(client, post_data):
"method": "a_method",
"target_db": "a_db"
}))
-def test_partial_correlation_api_with_non_existent_traits(client, post_data):
+def test_partial_correlation_api_with_non_existent_primary_traits(client, post_data):
"""
Check that the system responds appropriately in the case where the user
makes a request with a non-existent primary trait.
@@ -137,3 +134,45 @@ def test_partial_correlation_api_with_non_existent_traits(client, post_data):
assert (
response.status_code == 404 and response.is_json and
response.json.get("status") != "error")
+
+@pytest.mark.integration_test
+@pytest.mark.slow
+@pytest.mark.parametrize(
+ "post_data",
+ ({# ProbeSet
+ "primary_trait": {
+ "dataset": "UCLA_BXDBXH_CARTILAGE_V2", "name": "ILM103710672"},
+ "control_traits": [
+ {"dataset": "a_dataset", "name": "a_name"},
+ {"dataset": "a_dataset2", "name": "a_name2"}],
+ "method": "a_method",
+ "target_db": "a_db"
+ }, {# Publish
+ "primary_trait": {"dataset": "BXDPublish", "name": "BXD_12557"},
+ "control_traits": [
+ {"dataset": "a_dataset", "name": "a_name"},
+ {"dataset": "a_dataset2", "name": "a_name2"}],
+ "method": "a_method",
+ "target_db": "a_db"
+ }, {# Geno
+ "primary_trait": {"dataset": "AKXDGeno", "name": "D4Mit16"},
+ "control_traits": [
+ {"dataset": "a_dataset", "name": "a_name"},
+ {"dataset": "a_dataset2", "name": "a_name2"}],
+ "method": "a_method",
+ "target_db": "a_db"
+ }
+ # Temp -- the data in the database for these is ephemeral, making it
+ # difficult to test for this
+ ))
+def test_partial_correlation_api_with_non_existent_control_traits(client, post_data):
+ """
+ Check that the system responds appropriately in the case where the user
+ makes a request with a non-existent control traits.
+
+ The code repetition here is on purpose - valuing clarity over succinctness.
+ """
+ response = client.post("/api/correlation/partial", json=post_data)
+ assert (
+ response.status_code == 404 and response.is_json and
+ response.json.get("status") != "error")