diff options
author | Muriithi Frederick Muriuki | 2018-02-19 12:52:32 +0300 |
---|---|---|
committer | Pjotr Prins | 2018-03-26 09:29:29 +0000 |
commit | db86c21577e50b30ee222c47aae43e49a574c007 (patch) | |
tree | 74c73d79159bcc725152b22ba01126dd93d53af5 /test/requests | |
parent | c84bd98971aa5839cb6aa999889a92071890f579 (diff) | |
download | genenetwork2-db86c21577e50b30ee222c47aae43e49a574c007.tar.gz |
Add a runner for all integration tests.
Diffstat (limited to 'test/requests')
-rw-r--r-- | test/requests/run-integration-tests.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/requests/run-integration-tests.py b/test/requests/run-integration-tests.py new file mode 100644 index 00000000..0fd7bb20 --- /dev/null +++ b/test/requests/run-integration-tests.py @@ -0,0 +1,30 @@ +import sys +from test_login_local import TestLoginLocal +from test_registration import TestRegistration +from unittest import TestSuite, TextTestRunner, TestLoader + +test_cases = [ + TestLoginLocal, + TestRegistration +] + +def suite(gn2_url, es_url): + the_suite = TestSuite() + for case in test_cases: + the_suite.addTests(initTest(case, gn2_url, es_url)) + return the_suite + +def initTest(klass, gn2_url, es_url): + loader = TestLoader() + methodNames = loader.getTestCaseNames(klass) + return [klass(mname, gn2_url, es_url) for mname in methodNames] + +def main(gn2_url, es_url): + runner = TextTestRunner() + runner.run(suite(gn2_url, es_url)) + +if __name__ == "__main__": + if len(sys.argv) < 3: + raise Exception("Required arguments missing:\n\tTry running `run-integration-test.py <gn2-url> <es-url>`") + else: + main(sys.argv[1], sys.argv[2]) |