From c5fa6a7da673eefcb641b5765519ecdd8be6f190 Mon Sep 17 00:00:00 2001
From: Markus Scheidgen <markus@dhcp-46-238.physik.hu-berlin.de>
Date: Fri, 20 Sep 2019 14:54:56 +0200
Subject: [PATCH] Fixed wrong api path after api refactor.

---
 nomad/config.py       | 6 +++---
 tests/app/test_api.py | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/nomad/config.py b/nomad/config.py
index a72cb0264c..e96edfa61f 100644
--- a/nomad/config.py
+++ b/nomad/config.py
@@ -157,10 +157,10 @@ tests = NomadConfig(
 
 
 def api_url(ssl: bool = True):
-    return '%s://%s%s' % (
+    return '%s://%s/%s/api' % (
         'https' if services.https and ssl else 'http',
-        services.api_host,
-        services.api_base_path)
+        services.api_host.strip('/'),
+        services.api_base_path.strip('/'))
 
 
 migration_source_db = NomadConfig(
diff --git a/tests/app/test_api.py b/tests/app/test_api.py
index 03d1d710b5..4528e4cf8d 100644
--- a/tests/app/test_api.py
+++ b/tests/app/test_api.py
@@ -312,6 +312,7 @@ class TestUploads:
         assert rv.status_code == 200
         data = json.loads(rv.data)
         assert 'upload_command' in data
+        assert '/api/uploads' in data['upload_command']
         assert 'upload_url' in data
 
     def test_get_empty(self, api, test_user_auth, no_warn):
-- 
GitLab