From 303e4b71c2172da5be19c84d4be5a062329ac013 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 26 Aug 2020 19:12:33 +0300 Subject: Remove "from __future__ import new_feature" statements See: --- test/requests/main_web_functionality.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'test/requests/main_web_functionality.py') diff --git a/test/requests/main_web_functionality.py b/test/requests/main_web_functionality.py index d070dab9..78030307 100644 --- a/test/requests/main_web_functionality.py +++ b/test/requests/main_web_functionality.py @@ -1,9 +1,7 @@ -from __future__ import print_function -import re import requests from lxml.html import parse from link_checker import check_page -from requests.exceptions import ConnectionError + def check_home(url): doc = parse(url).getroot() @@ -11,20 +9,23 @@ def check_home(url): assert(search_button[0].value == "Search") print("OK") + def check_search_page(host): data = dict( - species="mouse" - , group="BXD" - , type="Hippocampus mRNA" - , dataset="HC_M2_0606_P" - , search_terms_or="" - , search_terms_and="MEAN=(15 16) LRS=(23 46)") + species="mouse", + group="BXD", + type="Hippocampus mRNA", + dataset="HC_M2_0606_P", + search_terms_or="", + search_terms_and="MEAN=(15 16) LRS=(23 46)") result = requests.get(host+"/search", params=data) found = result.text.find("records are shown below") assert(found >= 0) assert(result.status_code == 200) print("OK") - check_traits_page(host, "/show_trait?trait_id=1435395_s_at&dataset=HC_M2_0606_P") + check_traits_page(host, ("/show_trait?trait_id=1435395_" + "s_at&dataset=HC_M2_0606_P")) + def check_traits_page(host, traits_url): doc = parse(host+traits_url).getroot() @@ -33,6 +34,7 @@ def check_traits_page(host, traits_url): print("OK") check_page(host, host+traits_url) + def check_main_web_functionality(args_obj, parser): print("") print("Checking main web functionality...") -- cgit v1.2.3 From d52cc25d120173de3fd16bbd42ea38498d458e35 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 17 Sep 2020 21:19:00 +0300 Subject: Update Mechanical Rob * test/requests/link_checker.py (verify_static_file): Cast result.content.find's args to bytes. * test/requests/main_web_functionality.py (check_search_page): Update text to search for in a successful result. This value changed in 2aac6a06. --- test/requests/link_checker.py | 2 +- test/requests/main_web_functionality.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'test/requests/main_web_functionality.py') diff --git a/test/requests/link_checker.py b/test/requests/link_checker.py index e9943492..6ac26ba7 100644 --- a/test/requests/link_checker.py +++ b/test/requests/link_checker.py @@ -54,7 +54,7 @@ def verify_static_file(link): try: result = requests.get(link, timeout=20, verify=False) if (result.status_code == 200 and - result.content.find("Error: 404 Not Found") <= 0): + result.content.find(bytes("Error: 404 Not Found", "utf-8")) <= 0): print(link+" ==> OK") else: print("ERROR: link {}".format(link)) diff --git a/test/requests/main_web_functionality.py b/test/requests/main_web_functionality.py index 78030307..cefb8b8c 100644 --- a/test/requests/main_web_functionality.py +++ b/test/requests/main_web_functionality.py @@ -9,7 +9,6 @@ def check_home(url): assert(search_button[0].value == "Search") print("OK") - def check_search_page(host): data = dict( species="mouse", @@ -19,7 +18,7 @@ def check_search_page(host): search_terms_or="", search_terms_and="MEAN=(15 16) LRS=(23 46)") result = requests.get(host+"/search", params=data) - found = result.text.find("records are shown below") + found = result.text.find("records were found.") assert(found >= 0) assert(result.status_code == 200) print("OK") -- cgit v1.2.3