about summary refs log tree commit diff
path: root/test/requests/mapping_tests.py
diff options
context:
space:
mode:
authorzsloan2018-04-16 22:23:19 +0000
committerzsloan2018-04-16 22:23:19 +0000
commit35913e15bb6ac93c429e9465ebc36215cc6350ea (patch)
treed0eaff3a15bb167d995f1459ee7e744697f137b3 /test/requests/mapping_tests.py
parent273b79a0c2096a2eae5ce9aa2800917437459f68 (diff)
parentf511e38a9b440d08313471cdcc7bfd99add98f70 (diff)
downloadgenenetwork2-35913e15bb6ac93c429e9465ebc36215cc6350ea.tar.gz
Resolved conflicts after pulling changes
Diffstat (limited to 'test/requests/mapping_tests.py')
-rw-r--r--test/requests/mapping_tests.py35
1 files changed, 22 insertions, 13 deletions
diff --git a/test/requests/mapping_tests.py b/test/requests/mapping_tests.py
index fd20df11..8eb19de7 100644
--- a/test/requests/mapping_tests.py
+++ b/test/requests/mapping_tests.py
@@ -1,17 +1,10 @@
 from __future__ import print_function
 import re
+import copy
 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")
@@ -19,6 +12,8 @@ def load_data_from_file():
     return file_data
 
 def check_pylmm_tool_selection(host, data):
+    print("")
+    print("pylmm mapping tool selection")
     data["method"] = "pylmm"
     page = requests.post(host+"/marker_regression", data=data)
     doc = fromstring(page.text)
@@ -27,10 +22,24 @@ def check_pylmm_tool_selection(host, data):
     assert form.fields["value:BXD1"] == "15.034" # Check value in the file
 
 def check_R_qtl_tool_selection(host, data):
-    pass
+    print("")
+    print("R/qtl mapping tool selection")
+    headers = {"Content-Type": "application/x-www-form-urlencoded"}
+    page = requests.post(host+"/marker_regression", data=data, headers=headers)
+    doc = fromstring(page.text)
+    form = doc.forms[1]
+    assert form.fields["dataset"] == "HC_M2_0606_P"
+    assert form.fields["value:BXD1"] == "15.034"
 
 def check_CIM_tool_selection(host, data):
-    pass
+    print("")
+    print("CIM mapping tool selection (using reaper)")
+    data["method"] = "reaper"
+    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"
 
 def check_mapping(args_obj, parser):
     print("")
@@ -38,6 +47,6 @@ def check_mapping(args_obj, parser):
 
     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)
+    check_pylmm_tool_selection(host, copy.deepcopy(data))
+    check_R_qtl_tool_selection(host, copy.deepcopy(data)) ## Why does this fail?
+    check_CIM_tool_selection(host, copy.deepcopy(data))