aboutsummaryrefslogtreecommitdiff
path: root/test/requests/mapping_tests.py
diff options
context:
space:
mode:
authorzsloan2018-04-16 10:46:56 -0500
committerGitHub2018-04-16 10:46:56 -0500
commita58a4c3b8ee4f7256a18c99542ff6a9f355c0a2e (patch)
tree1e7677fa1fa210a2a957855578cd3ac3a47b720b /test/requests/mapping_tests.py
parent270f86c41f7c90cc4ca51bca0aec789a09a36a0e (diff)
parentebbc8c67c13b44df98ea3c2b355e86f77572543b (diff)
downloadgenenetwork2-a58a4c3b8ee4f7256a18c99542ff6a9f355c0a2e.tar.gz
Merge pull request #317 from pjotrp/testing
Testing
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))