aboutsummaryrefslogtreecommitdiff
path: root/test/requests/run-integration-tests.py
diff options
context:
space:
mode:
authorzsloan2018-03-29 10:36:12 -0500
committerGitHub2018-03-29 10:36:12 -0500
commitb215b5fe5c6d13f0ed445106230e1e38db71c918 (patch)
tree97f1f47b092bef38856ac34c1bd745e471c38311 /test/requests/run-integration-tests.py
parente67e3a76fca0bad4796853eb58140a412922bc9c (diff)
parente0c706c51c834caa836ecffd27a5d18fc23178ff (diff)
downloadgenenetwork2-b215b5fe5c6d13f0ed445106230e1e38db71c918.tar.gz
Merge pull request #297 from pjotrp/testing
Testing
Diffstat (limited to 'test/requests/run-integration-tests.py')
-rw-r--r--test/requests/run-integration-tests.py34
1 files changed, 34 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..5e816549
--- /dev/null
+++ b/test/requests/run-integration-tests.py
@@ -0,0 +1,34 @@
+import sys
+from test_login_local import TestLoginLocal
+from test_login_orcid import TestLoginOrcid
+from test_login_github import TestLoginGithub
+from test_registration import TestRegistration
+from unittest import TestSuite, TextTestRunner, TestLoader
+
+test_cases = [
+ TestRegistration
+ , TestLoginLocal
+ , TestLoginGithub
+ , TestLoginOrcid
+]
+
+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])