From 13d00e885600157cc253e9d03f26e712fed17346 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Fri, 18 Mar 2022 13:34:12 +0300 Subject: Apply "python-black" on file * test/requests/test-website.py: Run "black test/requests/test test-website.py". --- test/requests/test-website.py | 84 ++++++++++++++++++++++++++++++------------- 1 file changed, 60 insertions(+), 24 deletions(-) (limited to 'test') diff --git a/test/requests/test-website.py b/test/requests/test-website.py index 8b35c8ec..71055fca 100755 --- a/test/requests/test-website.py +++ b/test/requests/test-website.py @@ -18,6 +18,7 @@ from unittest import TestSuite, TextTestRunner, TestLoader print("Mechanical Rob firing up...") + def run_all(args_obj, parser): print("") print("Running all tests.") @@ -29,9 +30,11 @@ def run_all(args_obj, parser): check_mapping(args_obj, parser) # TODO: Add other functions as they are created. + def print_help(args_obj, parser): print(parser.format_help()) + def dummy(args_obj, parser): print("Not implemented yet.") @@ -41,6 +44,7 @@ def initTest(klass, gn2_url, es_url): methodNames = loader.getTestCaseNames(klass) return [klass(mname, gn2_url, es_url) for mname in methodNames] + desc = """ This is Mechanical-Rob - an automated web server tester for Genenetwork.org @@ -49,30 +53,62 @@ parser = argparse.ArgumentParser(description=desc) parser.add_argument("--fail", help="Fail and stop on any error", action="store_true") -parser.add_argument("-d", "--database", metavar="DB", type=str - , default="db_webqtl_s" - , help="Use database (default db_webqtl_s)") - -parser.add_argument("host", metavar="HOST", type=str - , default="http://localhost:5003" - , help="The url to the web server") - -parser.add_argument("-a", "--all", dest="accumulate", action="store_const" - , const=run_all, default=print_help - , help="Runs all tests.") - -parser.add_argument("-l", "--link-checker", dest="accumulate" - , action='store_const', const=check_links, default=print_help - , help="Checks for dead links.") - -parser.add_argument("-f", "--main-functionality", dest="accumulate" - , action='store_const', const=check_main_web_functionality - , default=print_help - , help="Checks for main web functionality.") - -parser.add_argument("-m", "--mapping", dest="accumulate" - , action="store_const", const=check_mapping, default=print_help - , help="Checks for mapping.") +parser.add_argument( + "-d", + "--database", + metavar="DB", + type=str, + default="db_webqtl_s", + help="Use database (default db_webqtl_s)", +) + +parser.add_argument( + "host", + metavar="HOST", + type=str, + default="http://localhost:5003", + help="The url to the web server", +) + +parser.add_argument( + "-a", + "--all", + dest="accumulate", + action="store_const", + const=run_all, + default=print_help, + help="Runs all tests.", +) + +parser.add_argument( + "-l", + "--link-checker", + dest="accumulate", + action="store_const", + const=check_links, + default=print_help, + help="Checks for dead links.", +) + +parser.add_argument( + "-f", + "--main-functionality", + dest="accumulate", + action="store_const", + const=check_main_web_functionality, + default=print_help, + help="Checks for main web functionality.", +) + +parser.add_argument( + "-m", + "--mapping", + dest="accumulate", + action="store_const", + const=check_mapping, + default=print_help, + help="Checks for mapping.", +) args = parser.parse_args() -- cgit v1.2.3