Merge branch 'master' into 3618-column-ordering
[arvados.git] / sdk / python / tests / run_test_server.py
index 867f5ab6062138d65853d186c512601e95a38d4d..bd3419c89dae47d857c22cd199c49f1722c3f8e0 100644 (file)
@@ -114,8 +114,8 @@ def run(websockets=False, reuse_server=False):
             subprocess.call(['bundle', 'exec', 'rails', 'server', '-d',
                              '--pid',
                              os.path.join(os.getcwd(), SERVER_PID_PATH),
-                             '-p3001'])
-            os.environ["ARVADOS_API_HOST"] = "127.0.0.1:3001"
+                             '-p3000'])
+            os.environ["ARVADOS_API_HOST"] = "127.0.0.1:3000"
 
         pid = find_server_pid(SERVER_PID_PATH)
 
@@ -167,8 +167,8 @@ def run_keep(blob_signing_key=None, enforce_permissions=False):
 
     keep_args = {}
     if blob_signing_key:
-        with open(os.path.join(TEST_TMPDIR, "keep.blob_signing_key", "w")) as f:
-            keep_args['--permission-key-file'] = f.filename
+        with open(os.path.join(TEST_TMPDIR, "keep.blob_signing_key"), "w") as f:
+            keep_args['--permission-key-file'] = f.name
             f.write(blob_signing_key)
     if enforce_permissions:
         keep_args['--enforce-permissions'] = 'true'
@@ -176,7 +176,7 @@ def run_keep(blob_signing_key=None, enforce_permissions=False):
     _start_keep(0, keep_args)
     _start_keep(1, keep_args)
 
-    os.environ["ARVADOS_API_HOST"] = "127.0.0.1:3001"
+    os.environ["ARVADOS_API_HOST"] = "127.0.0.1:3000"
     os.environ["ARVADOS_API_HOST_INSECURE"] = "true"
 
     authorize_with("admin")
@@ -210,7 +210,7 @@ def run_keep_proxy(auth):
     if not os.path.exists(TEST_TMPDIR):
         os.mkdir(TEST_TMPDIR)
 
-    os.environ["ARVADOS_API_HOST"] = "127.0.0.1:3001"
+    os.environ["ARVADOS_API_HOST"] = "127.0.0.1:3000"
     os.environ["ARVADOS_API_HOST_INSECURE"] = "true"
     os.environ["ARVADOS_API_TOKEN"] = fixture("api_client_authorizations")[auth]["api_token"]
 
@@ -231,7 +231,13 @@ def fixture(fix):
     '''load a fixture yaml file'''
     with open(os.path.join(SERVICES_SRC_DIR, 'api', "test", "fixtures",
                            fix + ".yml")) as f:
-        return yaml.load(f.read())
+        yaml_file = f.read()
+        try:
+          trim_index = yaml_file.index("# Test Helper trims the rest of the file")
+          yaml_file = yaml_file[0:trim_index]
+        except ValueError:
+          pass
+        return yaml.load(yaml_file)
 
 def authorize_with(token):
     '''token is the symbolic name of the token from the api_client_authorizations fixture'''