aboutsummaryrefslogtreecommitdiff
path: root/test/requests
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-08-10 12:02:54 +0300
committerFrederick Muriuki Muriithi2022-08-10 12:48:53 +0300
commitaebd4ec7ba5763953fefa9299e1cdcba19f7a673 (patch)
tree70dd9161d87fcc9edbce4824046387d22f5a7e5f /test/requests
parent3c117eebe6b0973db7f3fe6cf15f1109b883e629 (diff)
downloadgenenetwork2-aebd4ec7ba5763953fefa9299e1cdcba19f7a673.tar.gz
Fix formatting for legibility
Diffstat (limited to 'test/requests')
-rw-r--r--test/requests/correlation_tests.py44
-rwxr-xr-xtest/requests/test-website.py2
2 files changed, 46 insertions, 0 deletions
diff --git a/test/requests/correlation_tests.py b/test/requests/correlation_tests.py
new file mode 100644
index 00000000..b0213ff5
--- /dev/null
+++ b/test/requests/correlation_tests.py
@@ -0,0 +1,44 @@
+import requests
+from lxml.html import parse
+from link_checker import check_page
+
+def do_request(host, data):
+ return request.get(
+ f"{host}/corr_compute",
+ params={
+ **data,
+ "corr_dataset": "HC_M2_0606_P",
+ "corr_return_results": "100",
+ "corr_samples_group": "samples_primary",})
+
+def check_sample_correlations(baseurl):
+ data = {
+ "corr_type": "sample",
+ "corr_sample_method": "pearson",
+ "location_type": "gene"
+ }
+ result = do_request(host, data)
+ assert result.status == 200
+ assert (result.text.find("Values of record 1435464_at") >= 0), ""
+
+def check_tissue_correlations(baseurl):
+ data = {
+ "corr_type": "tissue"
+ }
+ result = do_request(host, data)
+ assert False, "Not implemented yet."
+
+def check_lit_correlations(baseurl):
+ data = {
+ "corr_type": "lit"
+ }
+ result = do_request(host, data)
+ assert False, "Not implemented yet."
+
+def check_correlations(args_obj, parser):
+ print("")
+ print("Checking the correlations...")
+ host = args_obj.host
+ check_sample_correlations(host)
+ check_tissue_correlations(host)
+ check_lit_correlations(host)
diff --git a/test/requests/test-website.py b/test/requests/test-website.py
index 71055fca..8062bff1 100755
--- a/test/requests/test-website.py
+++ b/test/requests/test-website.py
@@ -9,6 +9,7 @@ from link_checker import check_links
from link_checker import check_packaged_js_files
from mapping_tests import check_mapping
from navigation_tests import check_navigation
+from correlation_tests import check_correlations
from main_web_functionality import check_main_web_functionality
import link_checker
import sys
@@ -28,6 +29,7 @@ def run_all(args_obj, parser):
check_links(args_obj, parser)
check_packaged_js_files(args_obj, parser)
check_mapping(args_obj, parser)
+ check_correlations(args_obj, parser)
# TODO: Add other functions as they are created.