From 1eda8f9f3eac55953b3d54e32754e2ec312ab348 Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Wed, 9 Oct 2019 21:05:47 -0700 Subject: [PATCH] Rename "tests" directory to be "test" like in the swift repo In addition to being less confusing for devs, this lets us actually run tempauth tests in swiftclient dsvm jobs. The job definition (over in the swift repo) specifies test/sample.conf, which does not exist in this repo. As a result, those tests would skip with SKIPPING FUNCTIONAL TESTS DUE TO NO CONFIG Change-Id: I558dbf9a657d442e6e19468e543bbec855129eeb --- .functests | 2 +- .stestr.conf | 2 +- .unittests | 2 +- {tests => test}/__init__.py | 0 {tests => test}/functional/__init__.py | 0 {tests => test}/functional/test_swiftclient.py | 0 {tests => test}/sample.conf | 0 {tests => test}/unit/__init__.py | 0 {tests => test}/unit/test_authv1.py | 0 {tests => test}/unit/test_command_helpers.py | 0 {tests => test}/unit/test_multithreading.py | 0 {tests => test}/unit/test_service.py | 8 ++++---- {tests => test}/unit/test_shell.py | 0 {tests => test}/unit/test_swiftclient.py | 0 {tests => test}/unit/test_utils.py | 0 {tests => test}/unit/utils.py | 0 tox.ini | 4 ++-- 17 files changed, 9 insertions(+), 9 deletions(-) rename {tests => test}/__init__.py (100%) rename {tests => test}/functional/__init__.py (100%) rename {tests => test}/functional/test_swiftclient.py (100%) rename {tests => test}/sample.conf (100%) rename {tests => test}/unit/__init__.py (100%) rename {tests => test}/unit/test_authv1.py (100%) rename {tests => test}/unit/test_command_helpers.py (100%) rename {tests => test}/unit/test_multithreading.py (100%) rename {tests => test}/unit/test_service.py (99%) rename {tests => test}/unit/test_shell.py (100%) rename {tests => test}/unit/test_swiftclient.py (100%) rename {tests => test}/unit/test_utils.py (100%) rename {tests => test}/unit/utils.py (100%) diff --git a/.functests b/.functests index d199ec84..288c9e61 100755 --- a/.functests +++ b/.functests @@ -1,7 +1,7 @@ #!/bin/bash set -e -export OS_TEST_PATH='tests.functional' +export OS_TEST_PATH='test.functional' export PYTHON='coverage run --source swiftclient --parallel-mode' stestr run --concurrency=1 diff --git a/.stestr.conf b/.stestr.conf index 5228f209..90f5b813 100644 --- a/.stestr.conf +++ b/.stestr.conf @@ -1,4 +1,4 @@ [DEFAULT] -test_path=${OS_TEST_PATH:-./tests/unit} +test_path=${OS_TEST_PATH:-./test/unit} top_dir=./ diff --git a/.unittests b/.unittests index 5d935b1a..3a7ffe9b 100755 --- a/.unittests +++ b/.unittests @@ -1,7 +1,7 @@ #!/bin/bash set -e -python setup.py testr --coverage --testr-args="tests.unit" +python setup.py testr --coverage --testr-args="test.unit" RET=$? coverage report -m rm -f .coverage diff --git a/tests/__init__.py b/test/__init__.py similarity index 100% rename from tests/__init__.py rename to test/__init__.py diff --git a/tests/functional/__init__.py b/test/functional/__init__.py similarity index 100% rename from tests/functional/__init__.py rename to test/functional/__init__.py diff --git a/tests/functional/test_swiftclient.py b/test/functional/test_swiftclient.py similarity index 100% rename from tests/functional/test_swiftclient.py rename to test/functional/test_swiftclient.py diff --git a/tests/sample.conf b/test/sample.conf similarity index 100% rename from tests/sample.conf rename to test/sample.conf diff --git a/tests/unit/__init__.py b/test/unit/__init__.py similarity index 100% rename from tests/unit/__init__.py rename to test/unit/__init__.py diff --git a/tests/unit/test_authv1.py b/test/unit/test_authv1.py similarity index 100% rename from tests/unit/test_authv1.py rename to test/unit/test_authv1.py diff --git a/tests/unit/test_command_helpers.py b/test/unit/test_command_helpers.py similarity index 100% rename from tests/unit/test_command_helpers.py rename to test/unit/test_command_helpers.py diff --git a/tests/unit/test_multithreading.py b/test/unit/test_multithreading.py similarity index 100% rename from tests/unit/test_multithreading.py rename to test/unit/test_multithreading.py diff --git a/tests/unit/test_service.py b/test/unit/test_service.py similarity index 99% rename from tests/unit/test_service.py rename to test/unit/test_service.py index b7603522..ed3a2d6e 100644 --- a/tests/unit/test_service.py +++ b/test/unit/test_service.py @@ -36,7 +36,7 @@ from swiftclient.service import ( SwiftService, SwiftError, SwiftUploadObject ) -from tests.unit import utils as test_utils +from test.unit import utils as test_utils clean_os_environ = {} @@ -1060,11 +1060,11 @@ class TestService(unittest.TestCase): @mock.patch('swiftclient.service.getsize', return_value=4) def test_upload_with_relative_path(self, *args, **kwargs): service = SwiftService({}) - objects = [{'path': "./test", + objects = [{'path': "./testobj", 'strt_indx': 2}, - {'path': os.path.join(os.getcwd(), "test"), + {'path': os.path.join(os.getcwd(), "testobj"), 'strt_indx': 1}, - {'path': ".\\test", + {'path': ".\\testobj", 'strt_indx': 2}] for obj in objects: with mock.patch('swiftclient.service.Connection') as mock_conn, \ diff --git a/tests/unit/test_shell.py b/test/unit/test_shell.py similarity index 100% rename from tests/unit/test_shell.py rename to test/unit/test_shell.py diff --git a/tests/unit/test_swiftclient.py b/test/unit/test_swiftclient.py similarity index 100% rename from tests/unit/test_swiftclient.py rename to test/unit/test_swiftclient.py diff --git a/tests/unit/test_utils.py b/test/unit/test_utils.py similarity index 100% rename from tests/unit/test_utils.py rename to test/unit/test_utils.py diff --git a/tests/unit/utils.py b/test/unit/utils.py similarity index 100% rename from tests/unit/utils.py rename to test/unit/utils.py diff --git a/tox.ini b/tox.ini index 7dd864b3..002d24c5 100644 --- a/tox.ini +++ b/tox.ini @@ -24,7 +24,7 @@ passenv = SWIFT_* *_proxy [testenv:pep8] basepython = python3 commands = - python -m flake8 swiftclient tests + python -m flake8 swiftclient test [testenv:venv] basepython = python3 @@ -44,7 +44,7 @@ commands = [testenv:func] basepython = python3 setenv = - OS_TEST_PATH=tests.functional + OS_TEST_PATH=test.functional PYTHON=coverage run --source swiftclient --parallel-mode whitelist_externals = coverage