about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-08-10 12:02:54 +0300
committerFrederick Muriuki Muriithi2022-08-12 13:13:26 +0300
commit3cc448e8ee95173dda7f2d50c0cf2ce743cd1926 (patch)
tree04c16587c51347bb19cbe65c3daaa7d7cc9573e2 /test
parent361157f992af320abf73d93d9143b25017068184 (diff)
downloadgenenetwork2-3cc448e8ee95173dda7f2d50c0cf2ce743cd1926.tar.gz
Fix formatting for legibility
Diffstat (limited to 'test')
-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.