5200: Do not fail tests if application.yml is missing: defaults are enough to pass...
authorTom Clegg <tom@curoverse.com>
Thu, 12 Feb 2015 22:42:16 +0000 (17:42 -0500)
committerTom Clegg <tom@curoverse.com>
Thu, 12 Feb 2015 22:42:16 +0000 (17:42 -0500)
sdk/python/tests/test_arv_put.py

index 196264f766ae402cc64edba259c6bbfb2c1f23db..41fa8cfb66df03fc478d7f96642d6283c0ba5734 100644 (file)
@@ -399,9 +399,13 @@ class ArvadosPutTest(run_test_server.TestCaseWithServers, ArvadosBaseTestCase):
 class ArvPutIntegrationTest(run_test_server.TestCaseWithServers,
                             ArvadosBaseTestCase):
     def _getKeepServerConfig():
-        for config_file in ['application.yml', 'application.default.yml']:
-            with open(os.path.join(run_test_server.SERVICES_SRC_DIR,
-                                   "api", "config", config_file)) as f:
+        for config_file, mandatory in [
+                ['application.yml', True], ['application.default.yml', False]]:
+            path = os.path.join(run_test_server.SERVICES_SRC_DIR,
+                                "api", "config", config_file)
+            if not mandatory and not os.path.exists(path):
+                continue
+            with open(path) as f:
                 rails_config = yaml.load(f.read())
                 for config_section in ['test', 'common']:
                     try: