From 5aadf96d050682a44ed229187cd89ff50f2760eb Mon Sep 17 00:00:00 2001 From: Ruslan Kamaldinov Date: Sat, 9 May 2015 14:40:18 +0300 Subject: [PATCH] Move unit tests into unit test directory In order to pave the way for functional testing, move existing unit tests into a directory labeled unit. A subsequent patch will add a directory for functional tests. Change-Id: I08e592c328104139386b1199cdc9c3aa9841805f --- .testr.conf | 2 +- muranoclient/tests/unit/__init__.py | 0 muranoclient/tests/{ => unit}/base.py | 0 muranoclient/tests/{ => unit}/fakes.py | 0 .../{ => unit}/fixture_data/heat-template.yaml | 0 muranoclient/tests/{ => unit}/fixture_data/logo.png | Bin .../fixture_data/test-app/Classes/testapp.yaml | 0 .../fixture_data/test-app/Resources/Deploy.template | 0 .../test-app/Resources/scripts/common.sh | 0 .../test-app/Resources/scripts/deploy.sh | 0 .../test-app/Resources/scripts/installer.sh | 0 .../tests/{ => unit}/fixture_data/test-app/ui.yaml | 0 muranoclient/tests/{ => unit}/test_common_http.py | 2 +- muranoclient/tests/{ => unit}/test_methods.py | 0 .../tests/{ => unit}/test_package_creator.py | 2 +- muranoclient/tests/{ => unit}/test_shell.py | 4 ++-- muranoclient/tests/{ => unit}/test_utils.py | 0 tox.ini | 7 ++++--- 18 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 muranoclient/tests/unit/__init__.py rename muranoclient/tests/{ => unit}/base.py (100%) rename muranoclient/tests/{ => unit}/fakes.py (100%) rename muranoclient/tests/{ => unit}/fixture_data/heat-template.yaml (100%) rename muranoclient/tests/{ => unit}/fixture_data/logo.png (100%) rename muranoclient/tests/{ => unit}/fixture_data/test-app/Classes/testapp.yaml (100%) rename muranoclient/tests/{ => unit}/fixture_data/test-app/Resources/Deploy.template (100%) rename muranoclient/tests/{ => unit}/fixture_data/test-app/Resources/scripts/common.sh (100%) rename muranoclient/tests/{ => unit}/fixture_data/test-app/Resources/scripts/deploy.sh (100%) rename muranoclient/tests/{ => unit}/fixture_data/test-app/Resources/scripts/installer.sh (100%) rename muranoclient/tests/{ => unit}/fixture_data/test-app/ui.yaml (100%) rename muranoclient/tests/{ => unit}/test_common_http.py (99%) rename muranoclient/tests/{ => unit}/test_methods.py (100%) rename muranoclient/tests/{ => unit}/test_package_creator.py (99%) rename muranoclient/tests/{ => unit}/test_shell.py (99%) rename muranoclient/tests/{ => unit}/test_utils.py (100%) diff --git a/.testr.conf b/.testr.conf index 4da4d7db..70c6678f 100755 --- a/.testr.conf +++ b/.testr.conf @@ -2,6 +2,6 @@ test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ - ${PYTHON:-python} -m subunit.run discover $DISCOVER_DIRECTORY $LISTOPT $IDOPTION + ${PYTHON:-python} -m subunit.run discover -t ./ ./muranoclient/tests $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE test_list_option=--list diff --git a/muranoclient/tests/unit/__init__.py b/muranoclient/tests/unit/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/muranoclient/tests/base.py b/muranoclient/tests/unit/base.py similarity index 100% rename from muranoclient/tests/base.py rename to muranoclient/tests/unit/base.py diff --git a/muranoclient/tests/fakes.py b/muranoclient/tests/unit/fakes.py similarity index 100% rename from muranoclient/tests/fakes.py rename to muranoclient/tests/unit/fakes.py diff --git a/muranoclient/tests/fixture_data/heat-template.yaml b/muranoclient/tests/unit/fixture_data/heat-template.yaml similarity index 100% rename from muranoclient/tests/fixture_data/heat-template.yaml rename to muranoclient/tests/unit/fixture_data/heat-template.yaml diff --git a/muranoclient/tests/fixture_data/logo.png b/muranoclient/tests/unit/fixture_data/logo.png similarity index 100% rename from muranoclient/tests/fixture_data/logo.png rename to muranoclient/tests/unit/fixture_data/logo.png diff --git a/muranoclient/tests/fixture_data/test-app/Classes/testapp.yaml b/muranoclient/tests/unit/fixture_data/test-app/Classes/testapp.yaml similarity index 100% rename from muranoclient/tests/fixture_data/test-app/Classes/testapp.yaml rename to muranoclient/tests/unit/fixture_data/test-app/Classes/testapp.yaml diff --git a/muranoclient/tests/fixture_data/test-app/Resources/Deploy.template b/muranoclient/tests/unit/fixture_data/test-app/Resources/Deploy.template similarity index 100% rename from muranoclient/tests/fixture_data/test-app/Resources/Deploy.template rename to muranoclient/tests/unit/fixture_data/test-app/Resources/Deploy.template diff --git a/muranoclient/tests/fixture_data/test-app/Resources/scripts/common.sh b/muranoclient/tests/unit/fixture_data/test-app/Resources/scripts/common.sh similarity index 100% rename from muranoclient/tests/fixture_data/test-app/Resources/scripts/common.sh rename to muranoclient/tests/unit/fixture_data/test-app/Resources/scripts/common.sh diff --git a/muranoclient/tests/fixture_data/test-app/Resources/scripts/deploy.sh b/muranoclient/tests/unit/fixture_data/test-app/Resources/scripts/deploy.sh similarity index 100% rename from muranoclient/tests/fixture_data/test-app/Resources/scripts/deploy.sh rename to muranoclient/tests/unit/fixture_data/test-app/Resources/scripts/deploy.sh diff --git a/muranoclient/tests/fixture_data/test-app/Resources/scripts/installer.sh b/muranoclient/tests/unit/fixture_data/test-app/Resources/scripts/installer.sh similarity index 100% rename from muranoclient/tests/fixture_data/test-app/Resources/scripts/installer.sh rename to muranoclient/tests/unit/fixture_data/test-app/Resources/scripts/installer.sh diff --git a/muranoclient/tests/fixture_data/test-app/ui.yaml b/muranoclient/tests/unit/fixture_data/test-app/ui.yaml similarity index 100% rename from muranoclient/tests/fixture_data/test-app/ui.yaml rename to muranoclient/tests/unit/fixture_data/test-app/ui.yaml diff --git a/muranoclient/tests/test_common_http.py b/muranoclient/tests/unit/test_common_http.py similarity index 99% rename from muranoclient/tests/test_common_http.py rename to muranoclient/tests/unit/test_common_http.py index a9a857ab..65efd62a 100644 --- a/muranoclient/tests/test_common_http.py +++ b/muranoclient/tests/unit/test_common_http.py @@ -19,7 +19,7 @@ import testtools from muranoclient.common import exceptions as exc from muranoclient.common import http -from muranoclient.tests import fakes +from muranoclient.tests.unit import fakes @mock.patch('muranoclient.common.http.requests.request') diff --git a/muranoclient/tests/test_methods.py b/muranoclient/tests/unit/test_methods.py similarity index 100% rename from muranoclient/tests/test_methods.py rename to muranoclient/tests/unit/test_methods.py diff --git a/muranoclient/tests/test_package_creator.py b/muranoclient/tests/unit/test_package_creator.py similarity index 99% rename from muranoclient/tests/test_package_creator.py rename to muranoclient/tests/unit/test_package_creator.py index 89ab3794..9fea291b 100644 --- a/muranoclient/tests/test_package_creator.py +++ b/muranoclient/tests/unit/test_package_creator.py @@ -16,7 +16,7 @@ import os import shutil from muranoclient.openstack.common.apiclient import exceptions -from muranoclient.tests import base +from muranoclient.tests.unit import base from muranoclient.v1.package_creator import hot_package from muranoclient.v1.package_creator import mpl_package diff --git a/muranoclient/tests/test_shell.py b/muranoclient/tests/unit/test_shell.py similarity index 99% rename from muranoclient/tests/test_shell.py rename to muranoclient/tests/unit/test_shell.py index 0f7ac06c..c5ae44db 100644 --- a/muranoclient/tests/test_shell.py +++ b/muranoclient/tests/unit/test_shell.py @@ -31,8 +31,8 @@ from muranoclient.common import exceptions as common_exceptions from muranoclient.common import utils from muranoclient.openstack.common.apiclient import exceptions import muranoclient.shell -from muranoclient.tests import base -from muranoclient.tests import test_utils +from muranoclient.tests.unit import base +from muranoclient.tests.unit import test_utils from muranoclient.v1 import shell as v1_shell make_pkg = test_utils.make_pkg diff --git a/muranoclient/tests/test_utils.py b/muranoclient/tests/unit/test_utils.py similarity index 100% rename from muranoclient/tests/test_utils.py rename to muranoclient/tests/unit/test_utils.py diff --git a/tox.ini b/tox.ini index 81fd51b7..92516929 100644 --- a/tox.ini +++ b/tox.ini @@ -5,16 +5,17 @@ skipsdist = True [testenv] usedevelop = True +whitelist_externals = bash install_command = pip install -U {opts} {packages} -setenv = - VIRTUAL_ENV={envdir} +setenv = VIRTUAL_ENV={envdir} + deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = bash tools/pretty_tox.sh '{posargs}' [testenv:pep8] -commands = flake8 {posargs} +commands = flake8 {posargs} [testenv:venv] commands = {posargs}