From 9ac76616f62ef73f093ce63017782dda6bd3fc9d Mon Sep 17 00:00:00 2001 From: "francois.cellier" Date: Fri, 16 Mar 2018 15:51:01 +0100 Subject: Add unique constraints on db tables Change-Id: I8480ed2be16f73ada314f64f0bfda8e788288933 --- moon_manager/tests/functional_pod/run_functional_tests.sh | 7 +++++++ moon_manager/tests/unit_python/api/test_models.py | 9 +++++++++ 2 files changed, 16 insertions(+) (limited to 'moon_manager') 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 -- cgit 1.2.3-korg