aboutsummaryrefslogtreecommitdiff
path: root/test/requests/mapping_tests.py
diff options
context:
space:
mode:
authorPjotr Prins2018-03-19 10:52:28 +0100
committerGitHub2018-03-19 10:52:28 +0100
commitb359cb0712e9ef923d35524f310d841581d48f30 (patch)
tree3c4cafc0bc0b481490674c807f279b4371130d0c /test/requests/mapping_tests.py
parent2602be69f2869de376d1b9ced6131d880e9476c2 (diff)
parent5ccf077f53c6546bb9258c7116b4b1cf8903375f (diff)
downloadgenenetwork2-b359cb0712e9ef923d35524f310d841581d48f30.tar.gz
Merge pull request #5 from fredmanglis/testing
Testing
Diffstat (limited to 'test/requests/mapping_tests.py')
-rw-r--r--test/requests/mapping_tests.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/requests/mapping_tests.py b/test/requests/mapping_tests.py
new file mode 100644
index 00000000..fd20df11
--- /dev/null
+++ b/test/requests/mapping_tests.py
@@ -0,0 +1,43 @@
+from __future__ import print_function
+import re
+import json
+import requests
+from lxml.html import fromstring
+
+def get_data(list_item):
+ try:
+ value = list_item[1]
+ except:
+ value = None
+ #print("list_item:", list_item, "==>", value)
+ return value
+
+def load_data_from_file():
+ filename = "../test/data/input/mapping/1435395_s_at_HC_M2_0606_P.json"
+ file_handle = open(filename, "r")
+ file_data = json.loads(file_handle.read().encode("utf-8"))
+ return file_data
+
+def check_pylmm_tool_selection(host, data):
+ data["method"] = "pylmm"
+ page = requests.post(host+"/marker_regression", data=data)
+ doc = fromstring(page.text)
+ form = doc.forms[1]
+ assert form.fields["dataset"] == "HC_M2_0606_P"
+ assert form.fields["value:BXD1"] == "15.034" # Check value in the file
+
+def check_R_qtl_tool_selection(host, data):
+ pass
+
+def check_CIM_tool_selection(host, data):
+ pass
+
+def check_mapping(args_obj, parser):
+ print("")
+ print("Checking mapping")
+
+ host = args_obj.host
+ data = load_data_from_file()
+ check_pylmm_tool_selection(host, data)
+ check_R_qtl_tool_selection(host, data)
+ check_CIM_tool_selection(host, data)