diff options
Diffstat (limited to 'test/requests')
-rw-r--r-- | test/requests/correlation_tests.py | 44 | ||||
-rwxr-xr-x | test/requests/test-website.py | 2 |
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. |