From 9c14ca82d4d17dfa66cb0b68f1e9c72b62ff1749 Mon Sep 17 00:00:00 2001 From: Thomas Duval Date: Fri, 1 Dec 2017 11:18:17 +0100 Subject: Add unit tests for moon_db Change-Id: I98c18e696bd9dffe8c0ccc62df6c5210d78b4ab4 --- moonv4/moon_db/tests/README.md | 35 ++++ moonv4/moon_db/tests/unit_python/configure_db.sh | 9 - moonv4/moon_db/tests/unit_python/conftest.py | 201 +++++++++++++++++++++ moonv4/moon_db/tests/unit_python/requirements.txt | 5 + .../tests/unit_python/test_intraextension.py | 44 ----- moonv4/moon_db/tests/unit_python/test_policies.py | 77 ++++++++ moonv4/moon_db/tests/unit_python/test_tenant.py | 86 --------- 7 files changed, 318 insertions(+), 139 deletions(-) create mode 100644 moonv4/moon_db/tests/README.md delete mode 100644 moonv4/moon_db/tests/unit_python/configure_db.sh create mode 100644 moonv4/moon_db/tests/unit_python/conftest.py create mode 100644 moonv4/moon_db/tests/unit_python/requirements.txt delete mode 100644 moonv4/moon_db/tests/unit_python/test_intraextension.py create mode 100644 moonv4/moon_db/tests/unit_python/test_policies.py delete mode 100644 moonv4/moon_db/tests/unit_python/test_tenant.py (limited to 'moonv4/moon_db/tests') diff --git a/moonv4/moon_db/tests/README.md b/moonv4/moon_db/tests/README.md new file mode 100644 index 00000000..73a9fcd2 --- /dev/null +++ b/moonv4/moon_db/tests/README.md @@ -0,0 +1,35 @@ +# Tests + +## Python Unit Test for moon_db + +- launch Docker for Python unit tests + + + cd ${MOON_HOME}/moonv4/moon_db/ + docker run -ti --volume ${PWD}:/data asteroide/moon_tests + + +## Build and upload python packages + +- build python packages + + + python setup.py sdist bdist_wheel + + +- upload moon_db to PIP + + + python setup.py upload + + +or + + + gpg --detach-sign -u "${GPG_ID}" -a dist/moon_db-X.Y.Z-py3-none-any.whl + gpg --detach-sign -u "${GPG_ID}" -a dist/moon_db-X.Y.Z.tar.gz + twine upload dist/moon_db-X.Y.Z-py3-none-any.whl dist/moon_db-X.Y.Z-py3-none-any.whl.asc + twine upload dist/moon_db-X.Y.Z.tar.gz dist/moon_db-X.Y.Z.tar.gz.asc + + + diff --git a/moonv4/moon_db/tests/unit_python/configure_db.sh b/moonv4/moon_db/tests/unit_python/configure_db.sh deleted file mode 100644 index bdc259fe..00000000 --- a/moonv4/moon_db/tests/unit_python/configure_db.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -apt-get install mysql-server python-mysqldb python-pymysql - -mysql -uroot -ppassword <