aboutsummaryrefslogtreecommitdiffstats
path: root/moon_manager
diff options
context:
space:
mode:
authorfrancois.cellier <francois.cellier@orange.com>2018-03-16 15:51:01 +0100
committerThomas Duval <thomas.duval@orange.com>2018-03-22 17:22:31 +0100
commit9ac76616f62ef73f093ce63017782dda6bd3fc9d (patch)
tree57cf872e020268ec78f048ab53b0cf83da8bbb69 /moon_manager
parent6d2dbd0af7da445b39bbb7e16a36260268c685cd (diff)
Add unique constraints on db tables
Change-Id: I8480ed2be16f73ada314f64f0bfda8e788288933
Diffstat (limited to 'moon_manager')
-rw-r--r--moon_manager/tests/functional_pod/run_functional_tests.sh7
-rw-r--r--moon_manager/tests/unit_python/api/test_models.py9
2 files changed, 16 insertions, 0 deletions
diff --git a/moon_manager/tests/functional_pod/run_functional_tests.sh b/moon_manager/tests/functional_pod/run_functional_tests.sh
index 7a95a491..960e9480 100644
--- a/moon_manager/tests/functional_pod/run_functional_tests.sh
+++ b/moon_manager/tests/functional_pod/run_functional_tests.sh
@@ -1,4 +1,11 @@
#!/usr/bin/env bash
+if [ -d /data/dist ];
+then
+ pip install /data/dist/*.tar.gz --upgrade
+ pip install /data/dist/*.whl --upgrade
+fi
+
+
cd /data/tests/functional_pod
pytest .
diff --git a/moon_manager/tests/unit_python/api/test_models.py b/moon_manager/tests/unit_python/api/test_models.py
index 3c205d1d..b80e19f4 100644
--- a/moon_manager/tests/unit_python/api/test_models.py
+++ b/moon_manager/tests/unit_python/api/test_models.py
@@ -34,6 +34,14 @@ def delete_models_without_id(client):
return req
+def clean_models():
+ client = utilities.register_client()
+ req, models= get_models(client)
+ for key, value in models['models'].items():
+ print(key)
+ print(value)
+ client.delete("/models/{}".format(key))
+
def test_get_models():
client = utilities.register_client()
req, models= get_models(client)
@@ -43,6 +51,7 @@ def test_get_models():
def test_add_models():
+ clean_models()
client = utilities.register_client()
req, models = add_models(client, "testuser")
assert req.status_code == 200