From 39839def2e356e8d145be89380c73a71423cf06d Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Mon, 5 Sep 2016 22:14:33 -0700 Subject: [PATCH] move unit tests to new "unit" test module this will better isolate the unit tests from the functional tests. unfortunately, the "integration" tests had to be lumped into the "unit" tests since we need the separation in testr.conf Change-Id: Ifd12198c1f90e4e3c951c73bfa1884ab300d8ded --- .testr.conf | 2 +- .../tests/{api => unit}/__init__.py | 0 .../tests/{common => unit/api}/__init__.py | 0 openstackclient/tests/{ => unit}/api/fakes.py | 2 +- .../tests/{ => unit}/api/test_api.py | 2 +- .../tests/{ => unit}/api/test_image_v1.py | 2 +- .../tests/{ => unit}/api/test_image_v2.py | 2 +- .../{ => unit}/api/test_object_store_v1.py | 2 +- .../tests/{ => unit}/api/test_utils.py | 2 +- .../{compute => unit/common}/__init__.py | 0 .../common/test_availability_zone.py | 10 +- .../{ => unit}/common/test_clientmanager.py | 2 +- .../tests/{ => unit}/common/test_command.py | 6 +- .../{ => unit}/common/test_commandmanager.py | 2 +- .../{ => unit}/common/test_configuration.py | 4 +- .../tests/{ => unit}/common/test_extension.py | 12 +- .../tests/{ => unit}/common/test_logs.py | 2 +- .../tests/{ => unit}/common/test_module.py | 4 +- .../{ => unit}/common/test_parseractions.py | 2 +- .../tests/{ => unit}/common/test_quota.py | 8 +- .../{compute/v2 => unit/compute}/__init__.py | 0 .../{identity => unit/compute/v2}/__init__.py | 0 .../tests/{ => unit}/compute/v2/fakes.py | 12 +- .../tests/{ => unit}/compute/v2/test_agent.py | 4 +- .../{ => unit}/compute/v2/test_aggregate.py | 4 +- .../{ => unit}/compute/v2/test_console.py | 2 +- .../{ => unit}/compute/v2/test_flavor.py | 6 +- .../tests/{ => unit}/compute/v2/test_host.py | 4 +- .../{ => unit}/compute/v2/test_hypervisor.py | 4 +- .../compute/v2/test_hypervisor_stats.py | 2 +- .../{ => unit}/compute/v2/test_keypair.py | 4 +- .../{ => unit}/compute/v2/test_server.py | 8 +- .../compute/v2/test_server_backup.py | 4 +- .../compute/v2/test_server_group.py | 4 +- .../compute/v2/test_server_image.py | 4 +- .../{ => unit}/compute/v2/test_service.py | 2 +- openstackclient/tests/{ => unit}/fakes.py | 0 .../v2_0 => unit/identity}/__init__.py | 0 .../v3 => unit/identity/v2_0}/__init__.py | 0 .../tests/{ => unit}/identity/v2_0/fakes.py | 4 +- .../{ => unit}/identity/v2_0/test_catalog.py | 4 +- .../{ => unit}/identity/v2_0/test_endpoint.py | 2 +- .../{ => unit}/identity/v2_0/test_project.py | 2 +- .../{ => unit}/identity/v2_0/test_role.py | 2 +- .../identity/v2_0/test_role_assignment.py | 4 +- .../{ => unit}/identity/v2_0/test_service.py | 2 +- .../{ => unit}/identity/v2_0/test_token.py | 2 +- .../{ => unit}/identity/v2_0/test_user.py | 2 +- .../{image => unit/identity/v3}/__init__.py | 0 .../tests/{ => unit}/identity/v3/fakes.py | 4 +- .../{ => unit}/identity/v3/test_catalog.py | 4 +- .../{ => unit}/identity/v3/test_consumer.py | 4 +- .../{ => unit}/identity/v3/test_credential.py | 4 +- .../{ => unit}/identity/v3/test_domain.py | 2 +- .../{ => unit}/identity/v3/test_endpoint.py | 2 +- .../{ => unit}/identity/v3/test_group.py | 2 +- .../identity/v3/test_identity_provider.py | 4 +- .../{ => unit}/identity/v3/test_mappings.py | 4 +- .../{ => unit}/identity/v3/test_oauth.py | 4 +- .../{ => unit}/identity/v3/test_project.py | 2 +- .../{ => unit}/identity/v3/test_protocol.py | 4 +- .../{ => unit}/identity/v3/test_region.py | 4 +- .../tests/{ => unit}/identity/v3/test_role.py | 4 +- .../identity/v3/test_role_assignment.py | 4 +- .../{ => unit}/identity/v3/test_service.py | 2 +- .../identity/v3/test_service_provider.py | 4 +- .../{ => unit}/identity/v3/test_token.py | 2 +- .../{ => unit}/identity/v3/test_trust.py | 4 +- .../identity/v3/test_unscoped_saml.py | 4 +- .../tests/{ => unit}/identity/v3/test_user.py | 2 +- .../{image/v1 => unit/image}/__init__.py | 0 .../{image/v2 => unit/image/v1}/__init__.py | 0 .../tests/{ => unit}/image/v1/fakes.py | 6 +- .../tests/{ => unit}/image/v1/test_image.py | 4 +- .../{integ => unit/image/v2}/__init__.py | 0 .../tests/{ => unit}/image/v2/fakes.py | 6 +- .../tests/{ => unit}/image/v2/test_image.py | 4 +- .../{integ/cli => unit/integ}/__init__.py | 0 .../tests/{ => unit}/integ/base.py | 4 +- .../{network => unit/integ/cli}/__init__.py | 0 .../{ => unit}/integ/cli/test_project.py | 4 +- .../tests/{ => unit}/integ/cli/test_shell.py | 4 +- .../{network/v2 => unit/network}/__init__.py | 0 .../tests/{ => unit}/network/test_common.py | 2 +- .../{object => unit/network/v2}/__init__.py | 0 .../tests/{ => unit}/network/v2/fakes.py | 6 +- .../network/v2/test_address_scope.py | 6 +- .../{ => unit}/network/v2/test_floating_ip.py | 6 +- .../network/v2/test_floating_ip_pool.py | 4 +- .../network/v2/test_ip_availability.py | 6 +- .../{ => unit}/network/v2/test_network.py | 12 +- .../network/v2/test_network_agent.py | 4 +- .../network/v2/test_network_rbac.py | 6 +- .../network/v2/test_network_segment.py | 4 +- .../tests/{ => unit}/network/v2/test_port.py | 4 +- .../{ => unit}/network/v2/test_router.py | 4 +- .../network/v2/test_security_group.py | 8 +- .../network/v2/test_security_group_rule.py | 10 +- .../{ => unit}/network/v2/test_subnet.py | 6 +- .../{ => unit}/network/v2/test_subnet_pool.py | 6 +- .../{object/v1 => unit/object}/__init__.py | 0 .../{volume => unit/object/v1}/__init__.py | 0 .../tests/{ => unit}/object/v1/fakes.py | 2 +- .../{ => unit}/object/v1/test_container.py | 2 +- .../object/v1/test_container_all.py | 2 +- .../tests/{ => unit}/object/v1/test_object.py | 2 +- .../{ => unit}/object/v1/test_object_all.py | 2 +- .../tests/{ => unit}/test_shell.py | 0 openstackclient/tests/{ => unit}/utils.py | 2 +- .../{volume/v1 => unit/volume}/__init__.py | 0 .../{ => unit}/volume/test_find_resource.py | 2 +- .../{volume/v2 => unit/volume/v1}/__init__.py | 0 .../tests/{ => unit}/volume/v1/fakes.py | 6 +- .../{ => unit}/volume/v1/test_qos_specs.py | 4 +- .../tests/unit/volume/v1/test_service.py | 286 ++++++++++++++++++ .../volume/v1/test_transfer_request.py | 2 +- .../tests/{ => unit}/volume/v1/test_volume.py | 6 +- .../tests/unit/volume/v2/__init__.py | 0 .../tests/{ => unit}/volume/v2/fakes.py | 8 +- .../tests/{ => unit}/volume/v2/test_backup.py | 2 +- .../{ => unit}/volume/v2/test_qos_specs.py | 2 +- .../{ => unit}/volume/v2/test_service.py | 2 +- .../{ => unit}/volume/v2/test_snapshot.py | 2 +- .../volume/v2/test_transfer_request.py | 2 +- .../tests/{ => unit}/volume/v2/test_type.py | 6 +- .../tests/{ => unit}/volume/v2/test_volume.py | 6 +- 126 files changed, 492 insertions(+), 206 deletions(-) rename openstackclient/tests/{api => unit}/__init__.py (100%) rename openstackclient/tests/{common => unit/api}/__init__.py (100%) rename openstackclient/tests/{ => unit}/api/fakes.py (96%) rename openstackclient/tests/{ => unit}/api/test_api.py (99%) rename openstackclient/tests/{ => unit}/api/test_image_v1.py (98%) rename openstackclient/tests/{ => unit}/api/test_image_v2.py (98%) rename openstackclient/tests/{ => unit}/api/test_object_store_v1.py (99%) rename openstackclient/tests/{ => unit}/api/test_utils.py (98%) rename openstackclient/tests/{compute => unit/common}/__init__.py (100%) rename openstackclient/tests/{ => unit}/common/test_availability_zone.py (96%) rename openstackclient/tests/{ => unit}/common/test_clientmanager.py (98%) rename openstackclient/tests/{ => unit}/common/test_command.py (88%) rename openstackclient/tests/{ => unit}/common/test_commandmanager.py (98%) rename openstackclient/tests/{ => unit}/common/test_configuration.py (96%) rename openstackclient/tests/{ => unit}/common/test_extension.py (95%) rename openstackclient/tests/{ => unit}/common/test_logs.py (99%) rename openstackclient/tests/{ => unit}/common/test_module.py (97%) rename openstackclient/tests/{ => unit}/common/test_parseractions.py (99%) rename openstackclient/tests/{ => unit}/common/test_quota.py (98%) rename openstackclient/tests/{compute/v2 => unit/compute}/__init__.py (100%) rename openstackclient/tests/{identity => unit/compute/v2}/__init__.py (100%) rename openstackclient/tests/{ => unit}/compute/v2/fakes.py (99%) rename openstackclient/tests/{ => unit}/compute/v2/test_agent.py (98%) rename openstackclient/tests/{ => unit}/compute/v2/test_aggregate.py (99%) rename openstackclient/tests/{ => unit}/compute/v2/test_console.py (98%) rename openstackclient/tests/{ => unit}/compute/v2/test_flavor.py (99%) rename openstackclient/tests/{ => unit}/compute/v2/test_host.py (97%) rename openstackclient/tests/{ => unit}/compute/v2/test_hypervisor.py (98%) rename openstackclient/tests/{ => unit}/compute/v2/test_hypervisor_stats.py (96%) rename openstackclient/tests/{ => unit}/compute/v2/test_keypair.py (98%) rename openstackclient/tests/{ => unit}/compute/v2/test_server.py (99%) rename openstackclient/tests/{ => unit}/compute/v2/test_server_backup.py (98%) rename openstackclient/tests/{ => unit}/compute/v2/test_server_group.py (98%) rename openstackclient/tests/{ => unit}/compute/v2/test_server_image.py (98%) rename openstackclient/tests/{ => unit}/compute/v2/test_service.py (99%) rename openstackclient/tests/{ => unit}/fakes.py (100%) rename openstackclient/tests/{identity/v2_0 => unit/identity}/__init__.py (100%) rename openstackclient/tests/{identity/v3 => unit/identity/v2_0}/__init__.py (100%) rename openstackclient/tests/{ => unit}/identity/v2_0/fakes.py (99%) rename openstackclient/tests/{ => unit}/identity/v2_0/test_catalog.py (98%) rename openstackclient/tests/{ => unit}/identity/v2_0/test_endpoint.py (99%) rename openstackclient/tests/{ => unit}/identity/v2_0/test_project.py (99%) rename openstackclient/tests/{ => unit}/identity/v2_0/test_role.py (99%) rename openstackclient/tests/{ => unit}/identity/v2_0/test_role_assignment.py (98%) rename openstackclient/tests/{ => unit}/identity/v2_0/test_service.py (99%) rename openstackclient/tests/{ => unit}/identity/v2_0/test_token.py (97%) rename openstackclient/tests/{ => unit}/identity/v2_0/test_user.py (99%) rename openstackclient/tests/{image => unit/identity/v3}/__init__.py (100%) rename openstackclient/tests/{ => unit}/identity/v3/fakes.py (99%) rename openstackclient/tests/{ => unit}/identity/v3/test_catalog.py (97%) rename openstackclient/tests/{ => unit}/identity/v3/test_consumer.py (98%) rename openstackclient/tests/{ => unit}/identity/v3/test_credential.py (98%) rename openstackclient/tests/{ => unit}/identity/v3/test_domain.py (99%) rename openstackclient/tests/{ => unit}/identity/v3/test_endpoint.py (99%) rename openstackclient/tests/{ => unit}/identity/v3/test_group.py (99%) rename openstackclient/tests/{ => unit}/identity/v3/test_identity_provider.py (99%) rename openstackclient/tests/{ => unit}/identity/v3/test_mappings.py (98%) rename openstackclient/tests/{ => unit}/identity/v3/test_oauth.py (98%) rename openstackclient/tests/{ => unit}/identity/v3/test_project.py (99%) rename openstackclient/tests/{ => unit}/identity/v3/test_protocol.py (98%) rename openstackclient/tests/{ => unit}/identity/v3/test_region.py (98%) rename openstackclient/tests/{ => unit}/identity/v3/test_role.py (99%) rename openstackclient/tests/{ => unit}/identity/v3/test_role_assignment.py (99%) rename openstackclient/tests/{ => unit}/identity/v3/test_service.py (99%) rename openstackclient/tests/{ => unit}/identity/v3/test_service_provider.py (99%) rename openstackclient/tests/{ => unit}/identity/v3/test_token.py (98%) rename openstackclient/tests/{ => unit}/identity/v3/test_trust.py (98%) rename openstackclient/tests/{ => unit}/identity/v3/test_unscoped_saml.py (97%) rename openstackclient/tests/{ => unit}/identity/v3/test_user.py (99%) rename openstackclient/tests/{image/v1 => unit/image}/__init__.py (100%) rename openstackclient/tests/{image/v2 => unit/image/v1}/__init__.py (100%) rename openstackclient/tests/{ => unit}/image/v1/fakes.py (92%) rename openstackclient/tests/{ => unit}/image/v1/test_image.py (99%) rename openstackclient/tests/{integ => unit/image/v2}/__init__.py (100%) rename openstackclient/tests/{ => unit}/image/v2/fakes.py (98%) rename openstackclient/tests/{ => unit}/image/v2/test_image.py (99%) rename openstackclient/tests/{integ/cli => unit/integ}/__init__.py (100%) rename openstackclient/tests/{ => unit}/integ/base.py (97%) rename openstackclient/tests/{network => unit/integ/cli}/__init__.py (100%) rename openstackclient/tests/{ => unit}/integ/cli/test_project.py (98%) rename openstackclient/tests/{ => unit}/integ/cli/test_shell.py (99%) rename openstackclient/tests/{network/v2 => unit/network}/__init__.py (100%) rename openstackclient/tests/{ => unit}/network/test_common.py (99%) rename openstackclient/tests/{object => unit/network/v2}/__init__.py (100%) rename openstackclient/tests/{ => unit}/network/v2/fakes.py (99%) rename openstackclient/tests/{ => unit}/network/v2/test_address_scope.py (98%) rename openstackclient/tests/{ => unit}/network/v2/test_floating_ip.py (98%) rename openstackclient/tests/{ => unit}/network/v2/test_floating_ip_pool.py (95%) rename openstackclient/tests/{ => unit}/network/v2/test_ip_availability.py (96%) rename openstackclient/tests/{ => unit}/network/v2/test_network.py (98%) rename openstackclient/tests/{ => unit}/network/v2/test_network_agent.py (98%) rename openstackclient/tests/{ => unit}/network/v2/test_network_rbac.py (98%) rename openstackclient/tests/{ => unit}/network/v2/test_network_segment.py (97%) rename openstackclient/tests/{ => unit}/network/v2/test_port.py (99%) rename openstackclient/tests/{ => unit}/network/v2/test_router.py (99%) rename openstackclient/tests/{ => unit}/network/v2/test_security_group.py (98%) rename openstackclient/tests/{ => unit}/network/v2/test_security_group_rule.py (99%) rename openstackclient/tests/{ => unit}/network/v2/test_subnet.py (99%) rename openstackclient/tests/{ => unit}/network/v2/test_subnet_pool.py (99%) rename openstackclient/tests/{object/v1 => unit/object}/__init__.py (100%) rename openstackclient/tests/{volume => unit/object/v1}/__init__.py (100%) rename openstackclient/tests/{ => unit}/object/v1/fakes.py (98%) rename openstackclient/tests/{ => unit}/object/v1/test_container.py (99%) rename openstackclient/tests/{ => unit}/object/v1/test_container_all.py (99%) rename openstackclient/tests/{ => unit}/object/v1/test_object.py (99%) rename openstackclient/tests/{ => unit}/object/v1/test_object_all.py (98%) rename openstackclient/tests/{ => unit}/test_shell.py (100%) rename openstackclient/tests/{ => unit}/utils.py (98%) rename openstackclient/tests/{volume/v1 => unit/volume}/__init__.py (100%) rename openstackclient/tests/{ => unit}/volume/test_find_resource.py (97%) rename openstackclient/tests/{volume/v2 => unit/volume/v1}/__init__.py (100%) rename openstackclient/tests/{ => unit}/volume/v1/fakes.py (97%) rename openstackclient/tests/{ => unit}/volume/v1/test_qos_specs.py (99%) create mode 100644 openstackclient/tests/unit/volume/v1/test_service.py rename openstackclient/tests/{ => unit}/volume/v1/test_transfer_request.py (98%) rename openstackclient/tests/{ => unit}/volume/v1/test_volume.py (99%) create mode 100644 openstackclient/tests/unit/volume/v2/__init__.py rename openstackclient/tests/{ => unit}/volume/v2/fakes.py (98%) rename openstackclient/tests/{ => unit}/volume/v2/test_backup.py (99%) rename openstackclient/tests/{ => unit}/volume/v2/test_qos_specs.py (99%) rename openstackclient/tests/{ => unit}/volume/v2/test_service.py (99%) rename openstackclient/tests/{ => unit}/volume/v2/test_snapshot.py (99%) rename openstackclient/tests/{ => unit}/volume/v2/test_transfer_request.py (98%) rename openstackclient/tests/{ => unit}/volume/v2/test_type.py (98%) rename openstackclient/tests/{ => unit}/volume/v2/test_volume.py (99%) diff --git a/.testr.conf b/.testr.conf index 90c80c1873..633aae1faf 100644 --- a/.testr.conf +++ b/.testr.conf @@ -2,7 +2,7 @@ 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 -t ./ ${OS_TEST_PATH:-./openstackclient/tests} $LISTOPT $IDOPTION + ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./openstackclient/tests/unit} $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE test_list_option=--list diff --git a/openstackclient/tests/api/__init__.py b/openstackclient/tests/unit/__init__.py similarity index 100% rename from openstackclient/tests/api/__init__.py rename to openstackclient/tests/unit/__init__.py diff --git a/openstackclient/tests/common/__init__.py b/openstackclient/tests/unit/api/__init__.py similarity index 100% rename from openstackclient/tests/common/__init__.py rename to openstackclient/tests/unit/api/__init__.py diff --git a/openstackclient/tests/api/fakes.py b/openstackclient/tests/unit/api/fakes.py similarity index 96% rename from openstackclient/tests/api/fakes.py rename to openstackclient/tests/unit/api/fakes.py index 8d1d88ffc8..26213a2f42 100644 --- a/openstackclient/tests/api/fakes.py +++ b/openstackclient/tests/unit/api/fakes.py @@ -16,7 +16,7 @@ from keystoneauth1 import session from requests_mock.contrib import fixture -from openstackclient.tests import utils +from openstackclient.tests.unit import utils RESP_ITEM_1 = { diff --git a/openstackclient/tests/api/test_api.py b/openstackclient/tests/unit/api/test_api.py similarity index 99% rename from openstackclient/tests/api/test_api.py rename to openstackclient/tests/unit/api/test_api.py index b444d9f1f3..5f4a0c1afa 100644 --- a/openstackclient/tests/api/test_api.py +++ b/openstackclient/tests/unit/api/test_api.py @@ -16,7 +16,7 @@ from osc_lib import exceptions from openstackclient.api import api -from openstackclient.tests.api import fakes as api_fakes +from openstackclient.tests.unit.api import fakes as api_fakes class TestKeystoneSession(api_fakes.TestSession): diff --git a/openstackclient/tests/api/test_image_v1.py b/openstackclient/tests/unit/api/test_image_v1.py similarity index 98% rename from openstackclient/tests/api/test_image_v1.py rename to openstackclient/tests/unit/api/test_image_v1.py index f8ad669200..e02ef3812b 100644 --- a/openstackclient/tests/api/test_image_v1.py +++ b/openstackclient/tests/unit/api/test_image_v1.py @@ -17,7 +17,7 @@ from keystoneauth1 import session from requests_mock.contrib import fixture from openstackclient.api import image_v1 -from openstackclient.tests import utils +from openstackclient.tests.unit import utils FAKE_PROJECT = 'xyzpdq' diff --git a/openstackclient/tests/api/test_image_v2.py b/openstackclient/tests/unit/api/test_image_v2.py similarity index 98% rename from openstackclient/tests/api/test_image_v2.py rename to openstackclient/tests/unit/api/test_image_v2.py index 28b0d5803a..5dbb51e03c 100644 --- a/openstackclient/tests/api/test_image_v2.py +++ b/openstackclient/tests/unit/api/test_image_v2.py @@ -17,7 +17,7 @@ from keystoneauth1 import session from requests_mock.contrib import fixture from openstackclient.api import image_v2 -from openstackclient.tests import utils +from openstackclient.tests.unit import utils FAKE_PROJECT = 'xyzpdq' diff --git a/openstackclient/tests/api/test_object_store_v1.py b/openstackclient/tests/unit/api/test_object_store_v1.py similarity index 99% rename from openstackclient/tests/api/test_object_store_v1.py rename to openstackclient/tests/unit/api/test_object_store_v1.py index e6ac203d10..acf955501c 100644 --- a/openstackclient/tests/api/test_object_store_v1.py +++ b/openstackclient/tests/unit/api/test_object_store_v1.py @@ -19,7 +19,7 @@ from keystoneauth1 import session from requests_mock.contrib import fixture from openstackclient.api import object_store_v1 as object_store -from openstackclient.tests import utils +from openstackclient.tests.unit import utils FAKE_ACCOUNT = 'q12we34r' diff --git a/openstackclient/tests/api/test_utils.py b/openstackclient/tests/unit/api/test_utils.py similarity index 98% rename from openstackclient/tests/api/test_utils.py rename to openstackclient/tests/unit/api/test_utils.py index b87bdd13a0..1f52855864 100644 --- a/openstackclient/tests/api/test_utils.py +++ b/openstackclient/tests/unit/api/test_utils.py @@ -17,7 +17,7 @@ import copy from openstackclient.api import api from openstackclient.api import utils as api_utils -from openstackclient.tests.api import fakes as api_fakes +from openstackclient.tests.unit.api import fakes as api_fakes class TestBaseAPIFilter(api_fakes.TestSession): diff --git a/openstackclient/tests/compute/__init__.py b/openstackclient/tests/unit/common/__init__.py similarity index 100% rename from openstackclient/tests/compute/__init__.py rename to openstackclient/tests/unit/common/__init__.py diff --git a/openstackclient/tests/common/test_availability_zone.py b/openstackclient/tests/unit/common/test_availability_zone.py similarity index 96% rename from openstackclient/tests/common/test_availability_zone.py rename to openstackclient/tests/unit/common/test_availability_zone.py index 014ab8bced..6c7adc43b6 100644 --- a/openstackclient/tests/common/test_availability_zone.py +++ b/openstackclient/tests/unit/common/test_availability_zone.py @@ -16,11 +16,11 @@ import mock import six from openstackclient.common import availability_zone -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests import fakes -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils -from openstackclient.tests.volume.v2 import fakes as volume_fakes +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils +from openstackclient.tests.unit.volume.v2 import fakes as volume_fakes def _build_compute_az_datalist(compute_az, long_datalist=False): diff --git a/openstackclient/tests/common/test_clientmanager.py b/openstackclient/tests/unit/common/test_clientmanager.py similarity index 98% rename from openstackclient/tests/common/test_clientmanager.py rename to openstackclient/tests/unit/common/test_clientmanager.py index 625e175a1d..7f82c35d94 100644 --- a/openstackclient/tests/common/test_clientmanager.py +++ b/openstackclient/tests/unit/common/test_clientmanager.py @@ -19,7 +19,7 @@ from keystoneauth1 import token_endpoint from osc_lib.tests import utils as osc_lib_test_utils from openstackclient.common import clientmanager -from openstackclient.tests import fakes +from openstackclient.tests.unit import fakes class TestClientManager(osc_lib_test_utils.TestClientManager): diff --git a/openstackclient/tests/common/test_command.py b/openstackclient/tests/unit/common/test_command.py similarity index 88% rename from openstackclient/tests/common/test_command.py rename to openstackclient/tests/unit/common/test_command.py index 658bc895c0..f24b290b62 100644 --- a/openstackclient/tests/common/test_command.py +++ b/openstackclient/tests/unit/common/test_command.py @@ -17,8 +17,8 @@ import mock from osc_lib import exceptions from openstackclient.common import command -from openstackclient.tests import fakes as test_fakes -from openstackclient.tests import utils as test_utils +from openstackclient.tests.unit import fakes as test_fakes +from openstackclient.tests.unit import utils as test_utils class FakeCommand(command.Command): @@ -32,7 +32,7 @@ class TestCommand(test_utils.TestCase): def test_command_has_logger(self): cmd = FakeCommand(mock.Mock(), mock.Mock()) self.assertTrue(hasattr(cmd, 'log')) - self.assertEqual('openstackclient.tests.common.test_command.' + self.assertEqual('openstackclient.tests.unit.common.test_command.' 'FakeCommand', cmd.log.name) def test_validate_os_beta_command_enabled(self): diff --git a/openstackclient/tests/common/test_commandmanager.py b/openstackclient/tests/unit/common/test_commandmanager.py similarity index 98% rename from openstackclient/tests/common/test_commandmanager.py rename to openstackclient/tests/unit/common/test_commandmanager.py index e2b274dcb0..0c6c99c05d 100644 --- a/openstackclient/tests/common/test_commandmanager.py +++ b/openstackclient/tests/unit/common/test_commandmanager.py @@ -16,7 +16,7 @@ import mock from openstackclient.common import commandmanager -from openstackclient.tests import utils +from openstackclient.tests.unit import utils class FakeCommand(object): diff --git a/openstackclient/tests/common/test_configuration.py b/openstackclient/tests/unit/common/test_configuration.py similarity index 96% rename from openstackclient/tests/common/test_configuration.py rename to openstackclient/tests/unit/common/test_configuration.py index 915e5bd394..e10522b99c 100644 --- a/openstackclient/tests/common/test_configuration.py +++ b/openstackclient/tests/unit/common/test_configuration.py @@ -14,8 +14,8 @@ import mock from openstackclient.common import configuration -from openstackclient.tests import fakes -from openstackclient.tests import utils +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit import utils class TestConfiguration(utils.TestCommand): diff --git a/openstackclient/tests/common/test_extension.py b/openstackclient/tests/unit/common/test_extension.py similarity index 95% rename from openstackclient/tests/common/test_extension.py rename to openstackclient/tests/unit/common/test_extension.py index 10023aa6ac..bf856ed1c3 100644 --- a/openstackclient/tests/common/test_extension.py +++ b/openstackclient/tests/unit/common/test_extension.py @@ -14,12 +14,12 @@ import mock from openstackclient.common import extension -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests import fakes -from openstackclient.tests.identity.v2_0 import fakes as identity_fakes -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils -from openstackclient.tests.volume.v2 import fakes as volume_fakes +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils +from openstackclient.tests.unit.volume.v2 import fakes as volume_fakes class TestExtension(utils.TestCommand): diff --git a/openstackclient/tests/common/test_logs.py b/openstackclient/tests/unit/common/test_logs.py similarity index 99% rename from openstackclient/tests/common/test_logs.py rename to openstackclient/tests/unit/common/test_logs.py index 5091510cd3..4842c8d45c 100644 --- a/openstackclient/tests/common/test_logs.py +++ b/openstackclient/tests/unit/common/test_logs.py @@ -18,7 +18,7 @@ import logging import mock from openstackclient.common import logs -from openstackclient.tests import utils +from openstackclient.tests.unit import utils class TestContext(utils.TestCase): diff --git a/openstackclient/tests/common/test_module.py b/openstackclient/tests/unit/common/test_module.py similarity index 97% rename from openstackclient/tests/common/test_module.py rename to openstackclient/tests/unit/common/test_module.py index 8d5bb5f1f7..eb54dbe04b 100644 --- a/openstackclient/tests/common/test_module.py +++ b/openstackclient/tests/unit/common/test_module.py @@ -18,8 +18,8 @@ import mock from openstackclient.common import module as osc_module -from openstackclient.tests import fakes -from openstackclient.tests import utils +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit import utils # NOTE(dtroyer): module_1 must match the version list filter (not --all) diff --git a/openstackclient/tests/common/test_parseractions.py b/openstackclient/tests/unit/common/test_parseractions.py similarity index 99% rename from openstackclient/tests/common/test_parseractions.py rename to openstackclient/tests/unit/common/test_parseractions.py index 3038701f50..1212ad23d1 100644 --- a/openstackclient/tests/common/test_parseractions.py +++ b/openstackclient/tests/unit/common/test_parseractions.py @@ -19,7 +19,7 @@ import argparse from openstackclient.common import parseractions -from openstackclient.tests import utils +from openstackclient.tests.unit import utils class TestKeyValueAction(utils.TestCase): diff --git a/openstackclient/tests/common/test_quota.py b/openstackclient/tests/unit/common/test_quota.py similarity index 98% rename from openstackclient/tests/common/test_quota.py rename to openstackclient/tests/unit/common/test_quota.py index 16fa35f625..4a80a2b255 100644 --- a/openstackclient/tests/common/test_quota.py +++ b/openstackclient/tests/unit/common/test_quota.py @@ -14,10 +14,10 @@ import copy import mock from openstackclient.common import quota -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests import fakes -from openstackclient.tests.identity.v2_0 import fakes as identity_fakes -from openstackclient.tests.network.v2 import fakes as network_fakes +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes +from openstackclient.tests.unit.network.v2 import fakes as network_fakes class FakeQuotaResource(fakes.FakeResource): diff --git a/openstackclient/tests/compute/v2/__init__.py b/openstackclient/tests/unit/compute/__init__.py similarity index 100% rename from openstackclient/tests/compute/v2/__init__.py rename to openstackclient/tests/unit/compute/__init__.py diff --git a/openstackclient/tests/identity/__init__.py b/openstackclient/tests/unit/compute/v2/__init__.py similarity index 100% rename from openstackclient/tests/identity/__init__.py rename to openstackclient/tests/unit/compute/v2/__init__.py diff --git a/openstackclient/tests/compute/v2/fakes.py b/openstackclient/tests/unit/compute/v2/fakes.py similarity index 99% rename from openstackclient/tests/compute/v2/fakes.py rename to openstackclient/tests/unit/compute/v2/fakes.py index 85c11c9479..0e3d47ba84 100644 --- a/openstackclient/tests/compute/v2/fakes.py +++ b/openstackclient/tests/unit/compute/v2/fakes.py @@ -17,12 +17,12 @@ import copy import mock import uuid -from openstackclient.tests import fakes -from openstackclient.tests.identity.v2_0 import fakes as identity_fakes -from openstackclient.tests.image.v2 import fakes as image_fakes -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils -from openstackclient.tests.volume.v2 import fakes as volume_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes +from openstackclient.tests.unit.image.v2 import fakes as image_fakes +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils +from openstackclient.tests.unit.volume.v2 import fakes as volume_fakes floating_ip_num = 100 fix_ip_num = 100 diff --git a/openstackclient/tests/compute/v2/test_agent.py b/openstackclient/tests/unit/compute/v2/test_agent.py similarity index 98% rename from openstackclient/tests/compute/v2/test_agent.py rename to openstackclient/tests/unit/compute/v2/test_agent.py index 07265bb040..169940e29c 100644 --- a/openstackclient/tests/compute/v2/test_agent.py +++ b/openstackclient/tests/unit/compute/v2/test_agent.py @@ -19,8 +19,8 @@ from mock import call from osc_lib import exceptions from openstackclient.compute.v2 import agent -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit import utils as tests_utils class TestAgent(compute_fakes.TestComputev2): diff --git a/openstackclient/tests/compute/v2/test_aggregate.py b/openstackclient/tests/unit/compute/v2/test_aggregate.py similarity index 99% rename from openstackclient/tests/compute/v2/test_aggregate.py rename to openstackclient/tests/unit/compute/v2/test_aggregate.py index 3ebca35f9c..c636d3de2f 100644 --- a/openstackclient/tests/compute/v2/test_aggregate.py +++ b/openstackclient/tests/unit/compute/v2/test_aggregate.py @@ -20,8 +20,8 @@ from osc_lib import exceptions from osc_lib import utils from openstackclient.compute.v2 import aggregate -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit import utils as tests_utils class TestAggregate(compute_fakes.TestComputev2): diff --git a/openstackclient/tests/compute/v2/test_console.py b/openstackclient/tests/unit/compute/v2/test_console.py similarity index 98% rename from openstackclient/tests/compute/v2/test_console.py rename to openstackclient/tests/unit/compute/v2/test_console.py index fe4f26ae9a..d53d241e36 100644 --- a/openstackclient/tests/compute/v2/test_console.py +++ b/openstackclient/tests/unit/compute/v2/test_console.py @@ -16,7 +16,7 @@ import mock from openstackclient.compute.v2 import console -from openstackclient.tests.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes class TestConsole(compute_fakes.TestComputev2): diff --git a/openstackclient/tests/compute/v2/test_flavor.py b/openstackclient/tests/unit/compute/v2/test_flavor.py similarity index 99% rename from openstackclient/tests/compute/v2/test_flavor.py rename to openstackclient/tests/unit/compute/v2/test_flavor.py index d326ea8a88..ace650eb18 100644 --- a/openstackclient/tests/compute/v2/test_flavor.py +++ b/openstackclient/tests/unit/compute/v2/test_flavor.py @@ -20,9 +20,9 @@ from osc_lib import exceptions from osc_lib import utils from openstackclient.compute.v2 import flavor -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit import utils as tests_utils class TestFlavor(compute_fakes.TestComputev2): diff --git a/openstackclient/tests/compute/v2/test_host.py b/openstackclient/tests/unit/compute/v2/test_host.py similarity index 97% rename from openstackclient/tests/compute/v2/test_host.py rename to openstackclient/tests/unit/compute/v2/test_host.py index 9ebed68d45..a388172f9d 100644 --- a/openstackclient/tests/compute/v2/test_host.py +++ b/openstackclient/tests/unit/compute/v2/test_host.py @@ -14,8 +14,8 @@ # from openstackclient.compute.v2 import host -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit import utils as tests_utils class TestHost(compute_fakes.TestComputev2): diff --git a/openstackclient/tests/compute/v2/test_hypervisor.py b/openstackclient/tests/unit/compute/v2/test_hypervisor.py similarity index 98% rename from openstackclient/tests/compute/v2/test_hypervisor.py rename to openstackclient/tests/unit/compute/v2/test_hypervisor.py index ee0f40ed94..d94a107c26 100644 --- a/openstackclient/tests/compute/v2/test_hypervisor.py +++ b/openstackclient/tests/unit/compute/v2/test_hypervisor.py @@ -18,8 +18,8 @@ import copy from osc_lib import exceptions from openstackclient.compute.v2 import hypervisor -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests import fakes +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit import fakes class TestHypervisor(compute_fakes.TestComputev2): diff --git a/openstackclient/tests/compute/v2/test_hypervisor_stats.py b/openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py similarity index 96% rename from openstackclient/tests/compute/v2/test_hypervisor_stats.py rename to openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py index ca5ce29b38..40086f9bf2 100644 --- a/openstackclient/tests/compute/v2/test_hypervisor_stats.py +++ b/openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py @@ -14,7 +14,7 @@ # from openstackclient.compute.v2 import hypervisor_stats -from openstackclient.tests.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes class TestHypervisorStats(compute_fakes.TestComputev2): diff --git a/openstackclient/tests/compute/v2/test_keypair.py b/openstackclient/tests/unit/compute/v2/test_keypair.py similarity index 98% rename from openstackclient/tests/compute/v2/test_keypair.py rename to openstackclient/tests/unit/compute/v2/test_keypair.py index 25949e310b..cb0085452d 100644 --- a/openstackclient/tests/compute/v2/test_keypair.py +++ b/openstackclient/tests/unit/compute/v2/test_keypair.py @@ -20,8 +20,8 @@ from osc_lib import exceptions from osc_lib import utils from openstackclient.compute.v2 import keypair -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit import utils as tests_utils class TestKeypair(compute_fakes.TestComputev2): diff --git a/openstackclient/tests/compute/v2/test_server.py b/openstackclient/tests/unit/compute/v2/test_server.py similarity index 99% rename from openstackclient/tests/compute/v2/test_server.py rename to openstackclient/tests/unit/compute/v2/test_server.py index a98398eed5..d4843f51c1 100644 --- a/openstackclient/tests/compute/v2/test_server.py +++ b/openstackclient/tests/unit/compute/v2/test_server.py @@ -21,10 +21,10 @@ from osc_lib import exceptions from osc_lib import utils as common_utils from openstackclient.compute.v2 import server -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests.image.v2 import fakes as image_fakes -from openstackclient.tests import utils -from openstackclient.tests.volume.v2 import fakes as volume_fakes +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit.image.v2 import fakes as image_fakes +from openstackclient.tests.unit import utils +from openstackclient.tests.unit.volume.v2 import fakes as volume_fakes class TestServer(compute_fakes.TestComputev2): diff --git a/openstackclient/tests/compute/v2/test_server_backup.py b/openstackclient/tests/unit/compute/v2/test_server_backup.py similarity index 98% rename from openstackclient/tests/compute/v2/test_server_backup.py rename to openstackclient/tests/unit/compute/v2/test_server_backup.py index 8eeb0dcabd..9aa63fc7ca 100644 --- a/openstackclient/tests/compute/v2/test_server_backup.py +++ b/openstackclient/tests/unit/compute/v2/test_server_backup.py @@ -17,8 +17,8 @@ from osc_lib import exceptions from osc_lib import utils as common_utils from openstackclient.compute.v2 import server_backup -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests.image.v2 import fakes as image_fakes +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit.image.v2 import fakes as image_fakes class TestServerBackup(compute_fakes.TestComputev2): diff --git a/openstackclient/tests/compute/v2/test_server_group.py b/openstackclient/tests/unit/compute/v2/test_server_group.py similarity index 98% rename from openstackclient/tests/compute/v2/test_server_group.py rename to openstackclient/tests/unit/compute/v2/test_server_group.py index bd5f84714c..d474f41d80 100644 --- a/openstackclient/tests/compute/v2/test_server_group.py +++ b/openstackclient/tests/unit/compute/v2/test_server_group.py @@ -19,8 +19,8 @@ from osc_lib import exceptions from osc_lib import utils from openstackclient.compute.v2 import server_group -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit import utils as tests_utils class TestServerGroup(compute_fakes.TestComputev2): diff --git a/openstackclient/tests/compute/v2/test_server_image.py b/openstackclient/tests/unit/compute/v2/test_server_image.py similarity index 98% rename from openstackclient/tests/compute/v2/test_server_image.py rename to openstackclient/tests/unit/compute/v2/test_server_image.py index c3c52da05f..f53f08e6e0 100644 --- a/openstackclient/tests/compute/v2/test_server_image.py +++ b/openstackclient/tests/unit/compute/v2/test_server_image.py @@ -16,8 +16,8 @@ from osc_lib import exceptions from osc_lib import utils as common_utils from openstackclient.compute.v2 import server_image -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests.image.v2 import fakes as image_fakes +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit.image.v2 import fakes as image_fakes class TestServerImage(compute_fakes.TestComputev2): diff --git a/openstackclient/tests/compute/v2/test_service.py b/openstackclient/tests/unit/compute/v2/test_service.py similarity index 99% rename from openstackclient/tests/compute/v2/test_service.py rename to openstackclient/tests/unit/compute/v2/test_service.py index 1599f466b7..1fd3b7d59f 100644 --- a/openstackclient/tests/compute/v2/test_service.py +++ b/openstackclient/tests/unit/compute/v2/test_service.py @@ -19,7 +19,7 @@ from mock import call from osc_lib import exceptions from openstackclient.compute.v2 import service -from openstackclient.tests.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes class TestService(compute_fakes.TestComputev2): diff --git a/openstackclient/tests/fakes.py b/openstackclient/tests/unit/fakes.py similarity index 100% rename from openstackclient/tests/fakes.py rename to openstackclient/tests/unit/fakes.py diff --git a/openstackclient/tests/identity/v2_0/__init__.py b/openstackclient/tests/unit/identity/__init__.py similarity index 100% rename from openstackclient/tests/identity/v2_0/__init__.py rename to openstackclient/tests/unit/identity/__init__.py diff --git a/openstackclient/tests/identity/v3/__init__.py b/openstackclient/tests/unit/identity/v2_0/__init__.py similarity index 100% rename from openstackclient/tests/identity/v3/__init__.py rename to openstackclient/tests/unit/identity/v2_0/__init__.py diff --git a/openstackclient/tests/identity/v2_0/fakes.py b/openstackclient/tests/unit/identity/v2_0/fakes.py similarity index 99% rename from openstackclient/tests/identity/v2_0/fakes.py rename to openstackclient/tests/unit/identity/v2_0/fakes.py index 3e0b999364..3d25cadfa6 100644 --- a/openstackclient/tests/identity/v2_0/fakes.py +++ b/openstackclient/tests/unit/identity/v2_0/fakes.py @@ -20,8 +20,8 @@ import uuid from keystoneauth1 import access from keystoneauth1 import fixture -from openstackclient.tests import fakes -from openstackclient.tests import utils +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit import utils project_id = '8-9-64' diff --git a/openstackclient/tests/identity/v2_0/test_catalog.py b/openstackclient/tests/unit/identity/v2_0/test_catalog.py similarity index 98% rename from openstackclient/tests/identity/v2_0/test_catalog.py rename to openstackclient/tests/unit/identity/v2_0/test_catalog.py index 487d8f3161..c32f9fb856 100644 --- a/openstackclient/tests/identity/v2_0/test_catalog.py +++ b/openstackclient/tests/unit/identity/v2_0/test_catalog.py @@ -14,8 +14,8 @@ import mock from openstackclient.identity.v2_0 import catalog -from openstackclient.tests.identity.v2_0 import fakes as identity_fakes -from openstackclient.tests import utils +from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes +from openstackclient.tests.unit import utils class TestCatalog(utils.TestCommand): diff --git a/openstackclient/tests/identity/v2_0/test_endpoint.py b/openstackclient/tests/unit/identity/v2_0/test_endpoint.py similarity index 99% rename from openstackclient/tests/identity/v2_0/test_endpoint.py rename to openstackclient/tests/unit/identity/v2_0/test_endpoint.py index 26ec654d8b..915e04a500 100644 --- a/openstackclient/tests/identity/v2_0/test_endpoint.py +++ b/openstackclient/tests/unit/identity/v2_0/test_endpoint.py @@ -12,7 +12,7 @@ # from openstackclient.identity.v2_0 import endpoint -from openstackclient.tests.identity.v2_0 import fakes as identity_fakes +from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes class TestEndpoint(identity_fakes.TestIdentityv2): diff --git a/openstackclient/tests/identity/v2_0/test_project.py b/openstackclient/tests/unit/identity/v2_0/test_project.py similarity index 99% rename from openstackclient/tests/identity/v2_0/test_project.py rename to openstackclient/tests/unit/identity/v2_0/test_project.py index 96731c0c3e..c1f00762e4 100644 --- a/openstackclient/tests/identity/v2_0/test_project.py +++ b/openstackclient/tests/unit/identity/v2_0/test_project.py @@ -17,7 +17,7 @@ from keystoneauth1 import exceptions as ks_exc from osc_lib import exceptions from openstackclient.identity.v2_0 import project -from openstackclient.tests.identity.v2_0 import fakes as identity_fakes +from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes class TestProject(identity_fakes.TestIdentityv2): diff --git a/openstackclient/tests/identity/v2_0/test_role.py b/openstackclient/tests/unit/identity/v2_0/test_role.py similarity index 99% rename from openstackclient/tests/identity/v2_0/test_role.py rename to openstackclient/tests/unit/identity/v2_0/test_role.py index 3d379356ef..68ebf1418a 100644 --- a/openstackclient/tests/identity/v2_0/test_role.py +++ b/openstackclient/tests/unit/identity/v2_0/test_role.py @@ -19,7 +19,7 @@ from keystoneauth1 import exceptions as ks_exc from osc_lib import exceptions from openstackclient.identity.v2_0 import role -from openstackclient.tests.identity.v2_0 import fakes as identity_fakes +from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes class TestRole(identity_fakes.TestIdentityv2): diff --git a/openstackclient/tests/identity/v2_0/test_role_assignment.py b/openstackclient/tests/unit/identity/v2_0/test_role_assignment.py similarity index 98% rename from openstackclient/tests/identity/v2_0/test_role_assignment.py rename to openstackclient/tests/unit/identity/v2_0/test_role_assignment.py index a356ae0ad5..2730695936 100644 --- a/openstackclient/tests/identity/v2_0/test_role_assignment.py +++ b/openstackclient/tests/unit/identity/v2_0/test_role_assignment.py @@ -17,8 +17,8 @@ import mock from osc_lib import exceptions from openstackclient.identity.v2_0 import role_assignment -from openstackclient.tests import fakes -from openstackclient.tests.identity.v2_0 import fakes as identity_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes class TestRoleAssignment(identity_fakes.TestIdentityv2): diff --git a/openstackclient/tests/identity/v2_0/test_service.py b/openstackclient/tests/unit/identity/v2_0/test_service.py similarity index 99% rename from openstackclient/tests/identity/v2_0/test_service.py rename to openstackclient/tests/unit/identity/v2_0/test_service.py index 7efd2a6047..1948bf4ab0 100644 --- a/openstackclient/tests/identity/v2_0/test_service.py +++ b/openstackclient/tests/unit/identity/v2_0/test_service.py @@ -17,7 +17,7 @@ from keystoneclient import exceptions as identity_exc from osc_lib import exceptions from openstackclient.identity.v2_0 import service -from openstackclient.tests.identity.v2_0 import fakes as identity_fakes +from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes class TestService(identity_fakes.TestIdentityv2): diff --git a/openstackclient/tests/identity/v2_0/test_token.py b/openstackclient/tests/unit/identity/v2_0/test_token.py similarity index 97% rename from openstackclient/tests/identity/v2_0/test_token.py rename to openstackclient/tests/unit/identity/v2_0/test_token.py index 17115e6b37..dd7f4f4ab4 100644 --- a/openstackclient/tests/identity/v2_0/test_token.py +++ b/openstackclient/tests/unit/identity/v2_0/test_token.py @@ -16,7 +16,7 @@ import mock from openstackclient.identity.v2_0 import token -from openstackclient.tests.identity.v2_0 import fakes as identity_fakes +from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes class TestToken(identity_fakes.TestIdentityv2): diff --git a/openstackclient/tests/identity/v2_0/test_user.py b/openstackclient/tests/unit/identity/v2_0/test_user.py similarity index 99% rename from openstackclient/tests/identity/v2_0/test_user.py rename to openstackclient/tests/unit/identity/v2_0/test_user.py index ba87124755..765f8559a8 100644 --- a/openstackclient/tests/identity/v2_0/test_user.py +++ b/openstackclient/tests/unit/identity/v2_0/test_user.py @@ -19,7 +19,7 @@ from keystoneauth1 import exceptions as ks_exc from osc_lib import exceptions from openstackclient.identity.v2_0 import user -from openstackclient.tests.identity.v2_0 import fakes as identity_fakes +from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes class TestUser(identity_fakes.TestIdentityv2): diff --git a/openstackclient/tests/image/__init__.py b/openstackclient/tests/unit/identity/v3/__init__.py similarity index 100% rename from openstackclient/tests/image/__init__.py rename to openstackclient/tests/unit/identity/v3/__init__.py diff --git a/openstackclient/tests/identity/v3/fakes.py b/openstackclient/tests/unit/identity/v3/fakes.py similarity index 99% rename from openstackclient/tests/identity/v3/fakes.py rename to openstackclient/tests/unit/identity/v3/fakes.py index 38f6724e85..7b76fa6087 100644 --- a/openstackclient/tests/identity/v3/fakes.py +++ b/openstackclient/tests/unit/identity/v3/fakes.py @@ -20,8 +20,8 @@ import uuid from keystoneauth1 import access from keystoneauth1 import fixture -from openstackclient.tests import fakes -from openstackclient.tests import utils +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit import utils base_url = 'http://identity:5000/v3/' diff --git a/openstackclient/tests/identity/v3/test_catalog.py b/openstackclient/tests/unit/identity/v3/test_catalog.py similarity index 97% rename from openstackclient/tests/identity/v3/test_catalog.py rename to openstackclient/tests/unit/identity/v3/test_catalog.py index e3c5ed3d88..986c05f3ab 100644 --- a/openstackclient/tests/identity/v3/test_catalog.py +++ b/openstackclient/tests/unit/identity/v3/test_catalog.py @@ -14,8 +14,8 @@ import mock from openstackclient.identity.v3 import catalog -from openstackclient.tests.identity.v3 import fakes as identity_fakes -from openstackclient.tests import utils +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit import utils class TestCatalog(utils.TestCommand): diff --git a/openstackclient/tests/identity/v3/test_consumer.py b/openstackclient/tests/unit/identity/v3/test_consumer.py similarity index 98% rename from openstackclient/tests/identity/v3/test_consumer.py rename to openstackclient/tests/unit/identity/v3/test_consumer.py index d90c7347cf..403250ef56 100644 --- a/openstackclient/tests/identity/v3/test_consumer.py +++ b/openstackclient/tests/unit/identity/v3/test_consumer.py @@ -13,8 +13,8 @@ import copy from openstackclient.identity.v3 import consumer -from openstackclient.tests import fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestOAuth1(identity_fakes.TestOAuth1): diff --git a/openstackclient/tests/identity/v3/test_credential.py b/openstackclient/tests/unit/identity/v3/test_credential.py similarity index 98% rename from openstackclient/tests/identity/v3/test_credential.py rename to openstackclient/tests/unit/identity/v3/test_credential.py index b272087d10..fd3ae6b262 100644 --- a/openstackclient/tests/identity/v3/test_credential.py +++ b/openstackclient/tests/unit/identity/v3/test_credential.py @@ -16,8 +16,8 @@ from mock import call from osc_lib import exceptions from openstackclient.identity.v3 import credential -from openstackclient.tests.identity.v3 import fakes as identity_fakes -from openstackclient.tests import utils +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit import utils class TestCredential(identity_fakes.TestIdentityv3): diff --git a/openstackclient/tests/identity/v3/test_domain.py b/openstackclient/tests/unit/identity/v3/test_domain.py similarity index 99% rename from openstackclient/tests/identity/v3/test_domain.py rename to openstackclient/tests/unit/identity/v3/test_domain.py index 5e09402172..36f13d3326 100644 --- a/openstackclient/tests/identity/v3/test_domain.py +++ b/openstackclient/tests/unit/identity/v3/test_domain.py @@ -11,7 +11,7 @@ # under the License. from openstackclient.identity.v3 import domain -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestDomain(identity_fakes.TestIdentityv3): diff --git a/openstackclient/tests/identity/v3/test_endpoint.py b/openstackclient/tests/unit/identity/v3/test_endpoint.py similarity index 99% rename from openstackclient/tests/identity/v3/test_endpoint.py rename to openstackclient/tests/unit/identity/v3/test_endpoint.py index b2463a0d5e..765fbedde1 100644 --- a/openstackclient/tests/identity/v3/test_endpoint.py +++ b/openstackclient/tests/unit/identity/v3/test_endpoint.py @@ -11,7 +11,7 @@ # under the License. from openstackclient.identity.v3 import endpoint -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestEndpoint(identity_fakes.TestIdentityv3): diff --git a/openstackclient/tests/identity/v3/test_group.py b/openstackclient/tests/unit/identity/v3/test_group.py similarity index 99% rename from openstackclient/tests/identity/v3/test_group.py rename to openstackclient/tests/unit/identity/v3/test_group.py index a678dee9af..d35e98c691 100644 --- a/openstackclient/tests/identity/v3/test_group.py +++ b/openstackclient/tests/unit/identity/v3/test_group.py @@ -18,7 +18,7 @@ from keystoneauth1 import exceptions as ks_exc from osc_lib import exceptions from openstackclient.identity.v3 import group -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestGroup(identity_fakes.TestIdentityv3): diff --git a/openstackclient/tests/identity/v3/test_identity_provider.py b/openstackclient/tests/unit/identity/v3/test_identity_provider.py similarity index 99% rename from openstackclient/tests/identity/v3/test_identity_provider.py rename to openstackclient/tests/unit/identity/v3/test_identity_provider.py index d86ac11e3f..cb672a92a6 100644 --- a/openstackclient/tests/identity/v3/test_identity_provider.py +++ b/openstackclient/tests/unit/identity/v3/test_identity_provider.py @@ -16,8 +16,8 @@ import copy import mock from openstackclient.identity.v3 import identity_provider -from openstackclient.tests import fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestIdentityProvider(identity_fakes.TestFederatedIdentity): diff --git a/openstackclient/tests/identity/v3/test_mappings.py b/openstackclient/tests/unit/identity/v3/test_mappings.py similarity index 98% rename from openstackclient/tests/identity/v3/test_mappings.py rename to openstackclient/tests/unit/identity/v3/test_mappings.py index 09a383ebda..5086724c24 100644 --- a/openstackclient/tests/identity/v3/test_mappings.py +++ b/openstackclient/tests/unit/identity/v3/test_mappings.py @@ -18,8 +18,8 @@ import mock from osc_lib import exceptions from openstackclient.identity.v3 import mapping -from openstackclient.tests import fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestMapping(identity_fakes.TestFederatedIdentity): diff --git a/openstackclient/tests/identity/v3/test_oauth.py b/openstackclient/tests/unit/identity/v3/test_oauth.py similarity index 98% rename from openstackclient/tests/identity/v3/test_oauth.py rename to openstackclient/tests/unit/identity/v3/test_oauth.py index d3cf36553a..3aabd9b8ae 100644 --- a/openstackclient/tests/identity/v3/test_oauth.py +++ b/openstackclient/tests/unit/identity/v3/test_oauth.py @@ -13,8 +13,8 @@ import copy from openstackclient.identity.v3 import token -from openstackclient.tests import fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestOAuth1(identity_fakes.TestOAuth1): diff --git a/openstackclient/tests/identity/v3/test_project.py b/openstackclient/tests/unit/identity/v3/test_project.py similarity index 99% rename from openstackclient/tests/identity/v3/test_project.py rename to openstackclient/tests/unit/identity/v3/test_project.py index 65874baae4..702d920975 100644 --- a/openstackclient/tests/identity/v3/test_project.py +++ b/openstackclient/tests/unit/identity/v3/test_project.py @@ -18,7 +18,7 @@ import mock from osc_lib import exceptions from openstackclient.identity.v3 import project -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestProject(identity_fakes.TestIdentityv3): diff --git a/openstackclient/tests/identity/v3/test_protocol.py b/openstackclient/tests/unit/identity/v3/test_protocol.py similarity index 98% rename from openstackclient/tests/identity/v3/test_protocol.py rename to openstackclient/tests/unit/identity/v3/test_protocol.py index f718b27bd3..30b4aa4a11 100644 --- a/openstackclient/tests/identity/v3/test_protocol.py +++ b/openstackclient/tests/unit/identity/v3/test_protocol.py @@ -15,8 +15,8 @@ import copy from openstackclient.identity.v3 import federation_protocol -from openstackclient.tests import fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestProtocol(identity_fakes.TestFederatedIdentity): diff --git a/openstackclient/tests/identity/v3/test_region.py b/openstackclient/tests/unit/identity/v3/test_region.py similarity index 98% rename from openstackclient/tests/identity/v3/test_region.py rename to openstackclient/tests/unit/identity/v3/test_region.py index 41ee5ce9a6..e83a4e9f02 100644 --- a/openstackclient/tests/identity/v3/test_region.py +++ b/openstackclient/tests/unit/identity/v3/test_region.py @@ -14,8 +14,8 @@ import copy from openstackclient.identity.v3 import region -from openstackclient.tests import fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestRegion(identity_fakes.TestIdentityv3): diff --git a/openstackclient/tests/identity/v3/test_role.py b/openstackclient/tests/unit/identity/v3/test_role.py similarity index 99% rename from openstackclient/tests/identity/v3/test_role.py rename to openstackclient/tests/unit/identity/v3/test_role.py index b4e76d9649..448e18d372 100644 --- a/openstackclient/tests/identity/v3/test_role.py +++ b/openstackclient/tests/unit/identity/v3/test_role.py @@ -16,8 +16,8 @@ import copy from openstackclient.identity.v3 import role -from openstackclient.tests import fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestRole(identity_fakes.TestIdentityv3): diff --git a/openstackclient/tests/identity/v3/test_role_assignment.py b/openstackclient/tests/unit/identity/v3/test_role_assignment.py similarity index 99% rename from openstackclient/tests/identity/v3/test_role_assignment.py rename to openstackclient/tests/unit/identity/v3/test_role_assignment.py index 113cc493ec..7102a0cdae 100644 --- a/openstackclient/tests/identity/v3/test_role_assignment.py +++ b/openstackclient/tests/unit/identity/v3/test_role_assignment.py @@ -15,8 +15,8 @@ import copy import mock from openstackclient.identity.v3 import role_assignment -from openstackclient.tests import fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestRoleAssignment(identity_fakes.TestIdentityv3): diff --git a/openstackclient/tests/identity/v3/test_service.py b/openstackclient/tests/unit/identity/v3/test_service.py similarity index 99% rename from openstackclient/tests/identity/v3/test_service.py rename to openstackclient/tests/unit/identity/v3/test_service.py index 76c66aa5e1..4cba445bfc 100644 --- a/openstackclient/tests/identity/v3/test_service.py +++ b/openstackclient/tests/unit/identity/v3/test_service.py @@ -17,7 +17,7 @@ from keystoneclient import exceptions as identity_exc from osc_lib import exceptions from openstackclient.identity.v3 import service -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestService(identity_fakes.TestIdentityv3): diff --git a/openstackclient/tests/identity/v3/test_service_provider.py b/openstackclient/tests/unit/identity/v3/test_service_provider.py similarity index 99% rename from openstackclient/tests/identity/v3/test_service_provider.py rename to openstackclient/tests/unit/identity/v3/test_service_provider.py index 873ab1e759..57473ef956 100644 --- a/openstackclient/tests/identity/v3/test_service_provider.py +++ b/openstackclient/tests/unit/identity/v3/test_service_provider.py @@ -15,8 +15,8 @@ import copy from openstackclient.identity.v3 import service_provider -from openstackclient.tests import fakes -from openstackclient.tests.identity.v3 import fakes as service_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v3 import fakes as service_fakes class TestServiceProvider(service_fakes.TestFederatedIdentity): diff --git a/openstackclient/tests/identity/v3/test_token.py b/openstackclient/tests/unit/identity/v3/test_token.py similarity index 98% rename from openstackclient/tests/identity/v3/test_token.py rename to openstackclient/tests/unit/identity/v3/test_token.py index d7225e6c3b..7321909f47 100644 --- a/openstackclient/tests/identity/v3/test_token.py +++ b/openstackclient/tests/unit/identity/v3/test_token.py @@ -16,7 +16,7 @@ import mock from openstackclient.identity.v3 import token -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestToken(identity_fakes.TestIdentityv3): diff --git a/openstackclient/tests/identity/v3/test_trust.py b/openstackclient/tests/unit/identity/v3/test_trust.py similarity index 98% rename from openstackclient/tests/identity/v3/test_trust.py rename to openstackclient/tests/unit/identity/v3/test_trust.py index 1ea2feb444..4eeb8bfe17 100644 --- a/openstackclient/tests/identity/v3/test_trust.py +++ b/openstackclient/tests/unit/identity/v3/test_trust.py @@ -14,8 +14,8 @@ import copy from openstackclient.identity.v3 import trust -from openstackclient.tests import fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestTrust(identity_fakes.TestIdentityv3): diff --git a/openstackclient/tests/identity/v3/test_unscoped_saml.py b/openstackclient/tests/unit/identity/v3/test_unscoped_saml.py similarity index 97% rename from openstackclient/tests/identity/v3/test_unscoped_saml.py rename to openstackclient/tests/unit/identity/v3/test_unscoped_saml.py index 62623902b1..9e4e1876ae 100644 --- a/openstackclient/tests/identity/v3/test_unscoped_saml.py +++ b/openstackclient/tests/unit/identity/v3/test_unscoped_saml.py @@ -15,8 +15,8 @@ import copy from osc_lib import exceptions from openstackclient.identity.v3 import unscoped_saml -from openstackclient.tests import fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestUnscopedSAML(identity_fakes.TestFederatedIdentity): diff --git a/openstackclient/tests/identity/v3/test_user.py b/openstackclient/tests/unit/identity/v3/test_user.py similarity index 99% rename from openstackclient/tests/identity/v3/test_user.py rename to openstackclient/tests/unit/identity/v3/test_user.py index c3d9e749df..6150a5f3df 100644 --- a/openstackclient/tests/identity/v3/test_user.py +++ b/openstackclient/tests/unit/identity/v3/test_user.py @@ -17,7 +17,7 @@ import contextlib import mock from openstackclient.identity.v3 import user -from openstackclient.tests.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes class TestUser(identity_fakes.TestIdentityv3): diff --git a/openstackclient/tests/image/v1/__init__.py b/openstackclient/tests/unit/image/__init__.py similarity index 100% rename from openstackclient/tests/image/v1/__init__.py rename to openstackclient/tests/unit/image/__init__.py diff --git a/openstackclient/tests/image/v2/__init__.py b/openstackclient/tests/unit/image/v1/__init__.py similarity index 100% rename from openstackclient/tests/image/v2/__init__.py rename to openstackclient/tests/unit/image/v1/__init__.py diff --git a/openstackclient/tests/image/v1/fakes.py b/openstackclient/tests/unit/image/v1/fakes.py similarity index 92% rename from openstackclient/tests/image/v1/fakes.py rename to openstackclient/tests/unit/image/v1/fakes.py index 1e49f17325..a8e52fa32c 100644 --- a/openstackclient/tests/image/v1/fakes.py +++ b/openstackclient/tests/unit/image/v1/fakes.py @@ -15,9 +15,9 @@ import mock -from openstackclient.tests import fakes -from openstackclient.tests import utils -from openstackclient.tests.volume.v1 import fakes as volume_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit import utils +from openstackclient.tests.unit.volume.v1 import fakes as volume_fakes image_id = 'im1' diff --git a/openstackclient/tests/image/v1/test_image.py b/openstackclient/tests/unit/image/v1/test_image.py similarity index 99% rename from openstackclient/tests/image/v1/test_image.py rename to openstackclient/tests/unit/image/v1/test_image.py index cf08d138fa..c62c1ff92d 100644 --- a/openstackclient/tests/image/v1/test_image.py +++ b/openstackclient/tests/unit/image/v1/test_image.py @@ -19,8 +19,8 @@ import mock from osc_lib import exceptions from openstackclient.image.v1 import image -from openstackclient.tests import fakes -from openstackclient.tests.image.v1 import fakes as image_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.image.v1 import fakes as image_fakes class TestImage(image_fakes.TestImagev1): diff --git a/openstackclient/tests/integ/__init__.py b/openstackclient/tests/unit/image/v2/__init__.py similarity index 100% rename from openstackclient/tests/integ/__init__.py rename to openstackclient/tests/unit/image/v2/__init__.py diff --git a/openstackclient/tests/image/v2/fakes.py b/openstackclient/tests/unit/image/v2/fakes.py similarity index 98% rename from openstackclient/tests/image/v2/fakes.py rename to openstackclient/tests/unit/image/v2/fakes.py index d450dec17d..4d9f645833 100644 --- a/openstackclient/tests/image/v2/fakes.py +++ b/openstackclient/tests/unit/image/v2/fakes.py @@ -22,9 +22,9 @@ from glanceclient.v2 import schemas from osc_lib import utils as common_utils import warlock -from openstackclient.tests import fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes -from openstackclient.tests import utils +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit import utils image_id = '0f41529e-7c12-4de8-be2d-181abb825b3c' image_name = 'graven' diff --git a/openstackclient/tests/image/v2/test_image.py b/openstackclient/tests/unit/image/v2/test_image.py similarity index 99% rename from openstackclient/tests/image/v2/test_image.py rename to openstackclient/tests/unit/image/v2/test_image.py index 830590c96a..ebc9c3a759 100644 --- a/openstackclient/tests/image/v2/test_image.py +++ b/openstackclient/tests/unit/image/v2/test_image.py @@ -22,8 +22,8 @@ from osc_lib import utils as common_utils import warlock from openstackclient.image.v2 import image -from openstackclient.tests.identity.v3 import fakes as identity_fakes -from openstackclient.tests.image.v2 import fakes as image_fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit.image.v2 import fakes as image_fakes class TestImage(image_fakes.TestImagev2): diff --git a/openstackclient/tests/integ/cli/__init__.py b/openstackclient/tests/unit/integ/__init__.py similarity index 100% rename from openstackclient/tests/integ/cli/__init__.py rename to openstackclient/tests/unit/integ/__init__.py diff --git a/openstackclient/tests/integ/base.py b/openstackclient/tests/unit/integ/base.py similarity index 97% rename from openstackclient/tests/integ/base.py rename to openstackclient/tests/unit/integ/base.py index 9ee8489337..caed4f8902 100644 --- a/openstackclient/tests/integ/base.py +++ b/openstackclient/tests/unit/integ/base.py @@ -13,8 +13,8 @@ from keystoneauth1 import fixture as ksa_fixture from requests_mock.contrib import fixture -from openstackclient.tests import test_shell -from openstackclient.tests import utils +from openstackclient.tests.unit import test_shell +from openstackclient.tests.unit import utils HOST = "192.168.5.41" diff --git a/openstackclient/tests/network/__init__.py b/openstackclient/tests/unit/integ/cli/__init__.py similarity index 100% rename from openstackclient/tests/network/__init__.py rename to openstackclient/tests/unit/integ/cli/__init__.py diff --git a/openstackclient/tests/integ/cli/test_project.py b/openstackclient/tests/unit/integ/cli/test_project.py similarity index 98% rename from openstackclient/tests/integ/cli/test_project.py rename to openstackclient/tests/unit/integ/cli/test_project.py index 16d5f71713..6a7c6d1bd6 100644 --- a/openstackclient/tests/integ/cli/test_project.py +++ b/openstackclient/tests/unit/integ/cli/test_project.py @@ -15,8 +15,8 @@ import copy from osc_lib.tests import utils as osc_lib_utils from openstackclient import shell -from openstackclient.tests.integ import base as test_base -from openstackclient.tests import test_shell +from openstackclient.tests.unit.integ import base as test_base +from openstackclient.tests.unit import test_shell class TestIntegV2ProjectID(test_base.TestInteg): diff --git a/openstackclient/tests/integ/cli/test_shell.py b/openstackclient/tests/unit/integ/cli/test_shell.py similarity index 99% rename from openstackclient/tests/integ/cli/test_shell.py rename to openstackclient/tests/unit/integ/cli/test_shell.py index dad58f8ffb..9d819ed2e4 100644 --- a/openstackclient/tests/integ/cli/test_shell.py +++ b/openstackclient/tests/unit/integ/cli/test_shell.py @@ -16,8 +16,8 @@ import mock from osc_lib.tests import utils as osc_lib_utils from openstackclient import shell -from openstackclient.tests.integ import base as test_base -from openstackclient.tests import test_shell +from openstackclient.tests.unit.integ import base as test_base +from openstackclient.tests.unit import test_shell class TestIntegShellCliV2(test_base.TestInteg): diff --git a/openstackclient/tests/network/v2/__init__.py b/openstackclient/tests/unit/network/__init__.py similarity index 100% rename from openstackclient/tests/network/v2/__init__.py rename to openstackclient/tests/unit/network/__init__.py diff --git a/openstackclient/tests/network/test_common.py b/openstackclient/tests/unit/network/test_common.py similarity index 99% rename from openstackclient/tests/network/test_common.py rename to openstackclient/tests/unit/network/test_common.py index 48608734a2..325aad2a86 100644 --- a/openstackclient/tests/network/test_common.py +++ b/openstackclient/tests/unit/network/test_common.py @@ -15,7 +15,7 @@ import argparse import mock from openstackclient.network import common -from openstackclient.tests import utils +from openstackclient.tests.unit import utils def _add_common_argument(parser): diff --git a/openstackclient/tests/object/__init__.py b/openstackclient/tests/unit/network/v2/__init__.py similarity index 100% rename from openstackclient/tests/object/__init__.py rename to openstackclient/tests/unit/network/v2/__init__.py diff --git a/openstackclient/tests/network/v2/fakes.py b/openstackclient/tests/unit/network/v2/fakes.py similarity index 99% rename from openstackclient/tests/network/v2/fakes.py rename to openstackclient/tests/unit/network/v2/fakes.py index 33bc401798..ed30bad343 100644 --- a/openstackclient/tests/network/v2/fakes.py +++ b/openstackclient/tests/unit/network/v2/fakes.py @@ -16,9 +16,9 @@ import copy import mock import uuid -from openstackclient.tests import fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes_v3 -from openstackclient.tests import utils +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes_v3 +from openstackclient.tests.unit import utils QUOTA = { diff --git a/openstackclient/tests/network/v2/test_address_scope.py b/openstackclient/tests/unit/network/v2/test_address_scope.py similarity index 98% rename from openstackclient/tests/network/v2/test_address_scope.py rename to openstackclient/tests/unit/network/v2/test_address_scope.py index 342cf49b11..6d3f40110d 100644 --- a/openstackclient/tests/network/v2/test_address_scope.py +++ b/openstackclient/tests/unit/network/v2/test_address_scope.py @@ -17,9 +17,9 @@ from mock import call from osc_lib import exceptions from openstackclient.network.v2 import address_scope -from openstackclient.tests.identity.v3 import fakes as identity_fakes_v3 -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes_v3 +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils as tests_utils class TestAddressScope(network_fakes.TestNetworkV2): diff --git a/openstackclient/tests/network/v2/test_floating_ip.py b/openstackclient/tests/unit/network/v2/test_floating_ip.py similarity index 98% rename from openstackclient/tests/network/v2/test_floating_ip.py rename to openstackclient/tests/unit/network/v2/test_floating_ip.py index 234fe4465a..a40e48f4ba 100644 --- a/openstackclient/tests/network/v2/test_floating_ip.py +++ b/openstackclient/tests/unit/network/v2/test_floating_ip.py @@ -17,9 +17,9 @@ from mock import call from osc_lib import exceptions from openstackclient.network.v2 import floating_ip -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils as tests_utils # Tests for Neutron network diff --git a/openstackclient/tests/network/v2/test_floating_ip_pool.py b/openstackclient/tests/unit/network/v2/test_floating_ip_pool.py similarity index 95% rename from openstackclient/tests/network/v2/test_floating_ip_pool.py rename to openstackclient/tests/unit/network/v2/test_floating_ip_pool.py index 22d20d202d..11d01d36e4 100644 --- a/openstackclient/tests/network/v2/test_floating_ip_pool.py +++ b/openstackclient/tests/unit/network/v2/test_floating_ip_pool.py @@ -14,8 +14,8 @@ from osc_lib import exceptions from openstackclient.network.v2 import floating_ip_pool -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests.network.v2 import fakes as network_fakes +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit.network.v2 import fakes as network_fakes # Tests for Network API v2 diff --git a/openstackclient/tests/network/v2/test_ip_availability.py b/openstackclient/tests/unit/network/v2/test_ip_availability.py similarity index 96% rename from openstackclient/tests/network/v2/test_ip_availability.py rename to openstackclient/tests/unit/network/v2/test_ip_availability.py index f74bf8f72e..c929ab82c8 100644 --- a/openstackclient/tests/network/v2/test_ip_availability.py +++ b/openstackclient/tests/unit/network/v2/test_ip_availability.py @@ -16,9 +16,9 @@ import mock from osc_lib import utils as common_utils from openstackclient.network.v2 import ip_availability -from openstackclient.tests.identity.v3 import fakes as identity_fakes -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils as tests_utils class TestIPAvailability(network_fakes.TestNetworkV2): diff --git a/openstackclient/tests/network/v2/test_network.py b/openstackclient/tests/unit/network/v2/test_network.py similarity index 98% rename from openstackclient/tests/network/v2/test_network.py rename to openstackclient/tests/unit/network/v2/test_network.py index bb606819e0..84ead0938b 100644 --- a/openstackclient/tests/network/v2/test_network.py +++ b/openstackclient/tests/unit/network/v2/test_network.py @@ -18,12 +18,12 @@ from osc_lib import exceptions from osc_lib import utils from openstackclient.network.v2 import network -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests import fakes -from openstackclient.tests.identity.v2_0 import fakes as identity_fakes_v2 -from openstackclient.tests.identity.v3 import fakes as identity_fakes_v3 -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes_v2 +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes_v3 +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils as tests_utils # Tests for Neutron network diff --git a/openstackclient/tests/network/v2/test_network_agent.py b/openstackclient/tests/unit/network/v2/test_network_agent.py similarity index 98% rename from openstackclient/tests/network/v2/test_network_agent.py rename to openstackclient/tests/unit/network/v2/test_network_agent.py index 269d4e1d6d..2f17f41b04 100644 --- a/openstackclient/tests/network/v2/test_network_agent.py +++ b/openstackclient/tests/unit/network/v2/test_network_agent.py @@ -18,8 +18,8 @@ from osc_lib import exceptions from osc_lib import utils from openstackclient.network.v2 import network_agent -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils as tests_utils class TestNetworkAgent(network_fakes.TestNetworkV2): diff --git a/openstackclient/tests/network/v2/test_network_rbac.py b/openstackclient/tests/unit/network/v2/test_network_rbac.py similarity index 98% rename from openstackclient/tests/network/v2/test_network_rbac.py rename to openstackclient/tests/unit/network/v2/test_network_rbac.py index 9250e91b9e..1cd18a093f 100644 --- a/openstackclient/tests/network/v2/test_network_rbac.py +++ b/openstackclient/tests/unit/network/v2/test_network_rbac.py @@ -17,9 +17,9 @@ from mock import call from osc_lib import exceptions from openstackclient.network.v2 import network_rbac -from openstackclient.tests.identity.v3 import fakes as identity_fakes_v3 -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes_v3 +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils as tests_utils class TestNetworkRBAC(network_fakes.TestNetworkV2): diff --git a/openstackclient/tests/network/v2/test_network_segment.py b/openstackclient/tests/unit/network/v2/test_network_segment.py similarity index 97% rename from openstackclient/tests/network/v2/test_network_segment.py rename to openstackclient/tests/unit/network/v2/test_network_segment.py index a635d84597..b9fce0784f 100644 --- a/openstackclient/tests/network/v2/test_network_segment.py +++ b/openstackclient/tests/unit/network/v2/test_network_segment.py @@ -16,8 +16,8 @@ import mock from osc_lib import exceptions from openstackclient.network.v2 import network_segment -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils as tests_utils class TestNetworkSegment(network_fakes.TestNetworkV2): diff --git a/openstackclient/tests/network/v2/test_port.py b/openstackclient/tests/unit/network/v2/test_port.py similarity index 99% rename from openstackclient/tests/network/v2/test_port.py rename to openstackclient/tests/unit/network/v2/test_port.py index a1cecec8e7..d5d7f3309b 100644 --- a/openstackclient/tests/network/v2/test_port.py +++ b/openstackclient/tests/unit/network/v2/test_port.py @@ -19,8 +19,8 @@ from osc_lib import exceptions from osc_lib import utils from openstackclient.network.v2 import port -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils as tests_utils class TestPort(network_fakes.TestNetworkV2): diff --git a/openstackclient/tests/network/v2/test_router.py b/openstackclient/tests/unit/network/v2/test_router.py similarity index 99% rename from openstackclient/tests/network/v2/test_router.py rename to openstackclient/tests/unit/network/v2/test_router.py index 1ef4707b70..26fe655e30 100644 --- a/openstackclient/tests/network/v2/test_router.py +++ b/openstackclient/tests/unit/network/v2/test_router.py @@ -18,8 +18,8 @@ from osc_lib import exceptions from osc_lib import utils as osc_utils from openstackclient.network.v2 import router -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils as tests_utils class TestRouter(network_fakes.TestNetworkV2): diff --git a/openstackclient/tests/network/v2/test_security_group.py b/openstackclient/tests/unit/network/v2/test_security_group.py similarity index 98% rename from openstackclient/tests/network/v2/test_security_group.py rename to openstackclient/tests/unit/network/v2/test_security_group.py index 15f4cffe05..4c5b29721d 100644 --- a/openstackclient/tests/network/v2/test_security_group.py +++ b/openstackclient/tests/unit/network/v2/test_security_group.py @@ -17,10 +17,10 @@ from mock import call from osc_lib import exceptions from openstackclient.network.v2 import security_group -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils as tests_utils class TestSecurityGroupNetwork(network_fakes.TestNetworkV2): diff --git a/openstackclient/tests/network/v2/test_security_group_rule.py b/openstackclient/tests/unit/network/v2/test_security_group_rule.py similarity index 99% rename from openstackclient/tests/network/v2/test_security_group_rule.py rename to openstackclient/tests/unit/network/v2/test_security_group_rule.py index 170989bf28..51e18a6560 100644 --- a/openstackclient/tests/network/v2/test_security_group_rule.py +++ b/openstackclient/tests/unit/network/v2/test_security_group_rule.py @@ -19,11 +19,11 @@ from osc_lib import exceptions from openstackclient.network import utils as network_utils from openstackclient.network.v2 import security_group_rule -from openstackclient.tests.compute.v2 import fakes as compute_fakes -from openstackclient.tests import fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.compute.v2 import fakes as compute_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils as tests_utils class TestSecurityGroupRuleNetwork(network_fakes.TestNetworkV2): diff --git a/openstackclient/tests/network/v2/test_subnet.py b/openstackclient/tests/unit/network/v2/test_subnet.py similarity index 99% rename from openstackclient/tests/network/v2/test_subnet.py rename to openstackclient/tests/unit/network/v2/test_subnet.py index c117c6fdca..e31db4693d 100644 --- a/openstackclient/tests/network/v2/test_subnet.py +++ b/openstackclient/tests/unit/network/v2/test_subnet.py @@ -18,9 +18,9 @@ from osc_lib import exceptions from osc_lib import utils from openstackclient.network.v2 import subnet as subnet_v2 -from openstackclient.tests.identity.v3 import fakes as identity_fakes_v3 -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes_v3 +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils as tests_utils class TestSubnet(network_fakes.TestNetworkV2): diff --git a/openstackclient/tests/network/v2/test_subnet_pool.py b/openstackclient/tests/unit/network/v2/test_subnet_pool.py similarity index 99% rename from openstackclient/tests/network/v2/test_subnet_pool.py rename to openstackclient/tests/unit/network/v2/test_subnet_pool.py index 4cfecef7fb..0d9494c023 100644 --- a/openstackclient/tests/network/v2/test_subnet_pool.py +++ b/openstackclient/tests/unit/network/v2/test_subnet_pool.py @@ -19,9 +19,9 @@ from osc_lib import exceptions from osc_lib import utils from openstackclient.network.v2 import subnet_pool -from openstackclient.tests.identity.v3 import fakes as identity_fakes_v3 -from openstackclient.tests.network.v2 import fakes as network_fakes -from openstackclient.tests import utils as tests_utils +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes_v3 +from openstackclient.tests.unit.network.v2 import fakes as network_fakes +from openstackclient.tests.unit import utils as tests_utils class TestSubnetPool(network_fakes.TestNetworkV2): diff --git a/openstackclient/tests/object/v1/__init__.py b/openstackclient/tests/unit/object/__init__.py similarity index 100% rename from openstackclient/tests/object/v1/__init__.py rename to openstackclient/tests/unit/object/__init__.py diff --git a/openstackclient/tests/volume/__init__.py b/openstackclient/tests/unit/object/v1/__init__.py similarity index 100% rename from openstackclient/tests/volume/__init__.py rename to openstackclient/tests/unit/object/v1/__init__.py diff --git a/openstackclient/tests/object/v1/fakes.py b/openstackclient/tests/unit/object/v1/fakes.py similarity index 98% rename from openstackclient/tests/object/v1/fakes.py rename to openstackclient/tests/unit/object/v1/fakes.py index 6c36711127..0ff594bce0 100644 --- a/openstackclient/tests/object/v1/fakes.py +++ b/openstackclient/tests/unit/object/v1/fakes.py @@ -16,7 +16,7 @@ from keystoneauth1 import session from openstackclient.api import object_store_v1 as object_store -from openstackclient.tests import utils +from openstackclient.tests.unit import utils ACCOUNT_ID = 'tqbfjotld' diff --git a/openstackclient/tests/object/v1/test_container.py b/openstackclient/tests/unit/object/v1/test_container.py similarity index 99% rename from openstackclient/tests/object/v1/test_container.py rename to openstackclient/tests/unit/object/v1/test_container.py index 41bc6e8c6d..37b8c705b7 100644 --- a/openstackclient/tests/object/v1/test_container.py +++ b/openstackclient/tests/unit/object/v1/test_container.py @@ -18,7 +18,7 @@ import mock from openstackclient.api import object_store_v1 as object_store from openstackclient.object.v1 import container -from openstackclient.tests.object.v1 import fakes as object_fakes +from openstackclient.tests.unit.object.v1 import fakes as object_fakes AUTH_TOKEN = "foobar" diff --git a/openstackclient/tests/object/v1/test_container_all.py b/openstackclient/tests/unit/object/v1/test_container_all.py similarity index 99% rename from openstackclient/tests/object/v1/test_container_all.py rename to openstackclient/tests/unit/object/v1/test_container_all.py index 95e12f47f3..58c90e36d5 100644 --- a/openstackclient/tests/object/v1/test_container_all.py +++ b/openstackclient/tests/unit/object/v1/test_container_all.py @@ -16,7 +16,7 @@ import copy from requests_mock.contrib import fixture from openstackclient.object.v1 import container as container_cmds -from openstackclient.tests.object.v1 import fakes as object_fakes +from openstackclient.tests.unit.object.v1 import fakes as object_fakes class TestContainerAll(object_fakes.TestObjectv1): diff --git a/openstackclient/tests/object/v1/test_object.py b/openstackclient/tests/unit/object/v1/test_object.py similarity index 99% rename from openstackclient/tests/object/v1/test_object.py rename to openstackclient/tests/unit/object/v1/test_object.py index e11f78a130..c0ac204dad 100644 --- a/openstackclient/tests/object/v1/test_object.py +++ b/openstackclient/tests/unit/object/v1/test_object.py @@ -18,7 +18,7 @@ import mock from openstackclient.api import object_store_v1 as object_store from openstackclient.object.v1 import object as obj -from openstackclient.tests.object.v1 import fakes as object_fakes +from openstackclient.tests.unit.object.v1 import fakes as object_fakes AUTH_TOKEN = "foobar" diff --git a/openstackclient/tests/object/v1/test_object_all.py b/openstackclient/tests/unit/object/v1/test_object_all.py similarity index 98% rename from openstackclient/tests/object/v1/test_object_all.py rename to openstackclient/tests/unit/object/v1/test_object_all.py index 2a1bf05905..a0948b1bcf 100644 --- a/openstackclient/tests/object/v1/test_object_all.py +++ b/openstackclient/tests/unit/object/v1/test_object_all.py @@ -16,7 +16,7 @@ import copy from requests_mock.contrib import fixture from openstackclient.object.v1 import object as object_cmds -from openstackclient.tests.object.v1 import fakes as object_fakes +from openstackclient.tests.unit.object.v1 import fakes as object_fakes class TestObjectAll(object_fakes.TestObjectv1): diff --git a/openstackclient/tests/test_shell.py b/openstackclient/tests/unit/test_shell.py similarity index 100% rename from openstackclient/tests/test_shell.py rename to openstackclient/tests/unit/test_shell.py diff --git a/openstackclient/tests/utils.py b/openstackclient/tests/unit/utils.py similarity index 98% rename from openstackclient/tests/utils.py rename to openstackclient/tests/unit/utils.py index f3ab5ea63b..3c5c8683f1 100644 --- a/openstackclient/tests/utils.py +++ b/openstackclient/tests/unit/utils.py @@ -18,7 +18,7 @@ import fixtures import os import testtools -from openstackclient.tests import fakes +from openstackclient.tests.unit import fakes class ParserException(Exception): diff --git a/openstackclient/tests/volume/v1/__init__.py b/openstackclient/tests/unit/volume/__init__.py similarity index 100% rename from openstackclient/tests/volume/v1/__init__.py rename to openstackclient/tests/unit/volume/__init__.py diff --git a/openstackclient/tests/volume/test_find_resource.py b/openstackclient/tests/unit/volume/test_find_resource.py similarity index 97% rename from openstackclient/tests/volume/test_find_resource.py rename to openstackclient/tests/unit/volume/test_find_resource.py index 982b02f03d..d25093158c 100644 --- a/openstackclient/tests/volume/test_find_resource.py +++ b/openstackclient/tests/unit/volume/test_find_resource.py @@ -20,7 +20,7 @@ from cinderclient.v1 import volumes from osc_lib import exceptions from osc_lib import utils -from openstackclient.tests import utils as test_utils +from openstackclient.tests.unit import utils as test_utils from openstackclient.volume import client # noqa diff --git a/openstackclient/tests/volume/v2/__init__.py b/openstackclient/tests/unit/volume/v1/__init__.py similarity index 100% rename from openstackclient/tests/volume/v2/__init__.py rename to openstackclient/tests/unit/volume/v1/__init__.py diff --git a/openstackclient/tests/volume/v1/fakes.py b/openstackclient/tests/unit/volume/v1/fakes.py similarity index 97% rename from openstackclient/tests/volume/v1/fakes.py rename to openstackclient/tests/unit/volume/v1/fakes.py index b96f925dce..c6fee7d196 100644 --- a/openstackclient/tests/volume/v1/fakes.py +++ b/openstackclient/tests/unit/volume/v1/fakes.py @@ -15,9 +15,9 @@ import mock -from openstackclient.tests import fakes -from openstackclient.tests.identity.v2_0 import fakes as identity_fakes -from openstackclient.tests import utils +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes +from openstackclient.tests.unit import utils volume_id = 'vvvvvvvv-vvvv-vvvv-vvvvvvvv' diff --git a/openstackclient/tests/volume/v1/test_qos_specs.py b/openstackclient/tests/unit/volume/v1/test_qos_specs.py similarity index 99% rename from openstackclient/tests/volume/v1/test_qos_specs.py rename to openstackclient/tests/unit/volume/v1/test_qos_specs.py index 4e1733fde5..7b87ccb3d1 100644 --- a/openstackclient/tests/volume/v1/test_qos_specs.py +++ b/openstackclient/tests/unit/volume/v1/test_qos_specs.py @@ -17,8 +17,8 @@ import copy from osc_lib import utils -from openstackclient.tests import fakes -from openstackclient.tests.volume.v1 import fakes as volume_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.volume.v1 import fakes as volume_fakes from openstackclient.volume.v1 import qos_specs diff --git a/openstackclient/tests/unit/volume/v1/test_service.py b/openstackclient/tests/unit/volume/v1/test_service.py new file mode 100644 index 0000000000..82d21bfc42 --- /dev/null +++ b/openstackclient/tests/unit/volume/v1/test_service.py @@ -0,0 +1,286 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# + +from osc_lib import exceptions + +from openstackclient.tests.unit.volume.v1 import fakes as service_fakes +from openstackclient.volume.v1 import service + + +class TestService(service_fakes.TestVolumev1): + + def setUp(self): + super(TestService, self).setUp() + + # Get a shortcut to the ServiceManager Mock + self.service_mock = self.app.client_manager.volume.services + self.service_mock.reset_mock() + + +class TestServiceList(TestService): + + # The service to be listed + services = service_fakes.FakeService.create_one_service() + + def setUp(self): + super(TestServiceList, self).setUp() + + self.service_mock.list.return_value = [self.services] + + # Get the command object to test + self.cmd = service.ListService(self.app, None) + + def test_service_list(self): + arglist = [ + '--host', self.services.host, + '--service', self.services.binary, + ] + verifylist = [ + ('host', self.services.host), + ('service', self.services.binary), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + # In base command class Lister in cliff, abstract method take_action() + # returns a tuple containing the column names and an iterable + # containing the data to be listed. + columns, data = self.cmd.take_action(parsed_args) + + expected_columns = [ + 'Binary', + 'Host', + 'Zone', + 'Status', + 'State', + 'Updated At', + ] + + # confirming if all expected columns are present in the result. + self.assertEqual(expected_columns, columns) + + datalist = (( + self.services.binary, + self.services.host, + self.services.zone, + self.services.status, + self.services.state, + self.services.updated_at, + ), ) + + # confirming if all expected values are present in the result. + self.assertEqual(datalist, tuple(data)) + + # checking if proper call was made to list services + self.service_mock.list.assert_called_with( + self.services.host, + self.services.binary, + ) + + # checking if prohibited columns are present in output + self.assertNotIn("Disabled Reason", columns) + self.assertNotIn(self.services.disabled_reason, + tuple(data)) + + def test_service_list_with_long_option(self): + arglist = [ + '--host', self.services.host, + '--service', self.services.binary, + '--long' + ] + verifylist = [ + ('host', self.services.host), + ('service', self.services.binary), + ('long', True) + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + # In base command class Lister in cliff, abstract method take_action() + # returns a tuple containing the column names and an iterable + # containing the data to be listed. + columns, data = self.cmd.take_action(parsed_args) + + expected_columns = [ + 'Binary', + 'Host', + 'Zone', + 'Status', + 'State', + 'Updated At', + 'Disabled Reason' + ] + + # confirming if all expected columns are present in the result. + self.assertEqual(expected_columns, columns) + + datalist = (( + self.services.binary, + self.services.host, + self.services.zone, + self.services.status, + self.services.state, + self.services.updated_at, + self.services.disabled_reason, + ), ) + + # confirming if all expected values are present in the result. + self.assertEqual(datalist, tuple(data)) + + self.service_mock.list.assert_called_with( + self.services.host, + self.services.binary, + ) + + +class TestServiceSet(TestService): + + service = service_fakes.FakeService.create_one_service() + + def setUp(self): + super(TestServiceSet, self).setUp() + + self.service_mock.enable.return_value = self.service + self.service_mock.disable.return_value = self.service + self.service_mock.disable_log_reason.return_value = self.service + + self.cmd = service.SetService(self.app, None) + + def test_service_set_nothing(self): + arglist = [ + self.service.host, + self.service.binary, + ] + verifylist = [ + ('host', self.service.host), + ('service', self.service.binary), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + result = self.cmd.take_action(parsed_args) + + self.service_mock.enable.assert_not_called() + self.service_mock.disable.assert_not_called() + self.service_mock.disable_log_reason.assert_not_called() + self.assertIsNone(result) + + def test_service_set_enable(self): + arglist = [ + '--enable', + self.service.host, + self.service.binary, + ] + verifylist = [ + ('enable', True), + ('host', self.service.host), + ('service', self.service.binary), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + result = self.cmd.take_action(parsed_args) + + self.service_mock.enable.assert_called_with( + self.service.host, + self.service.binary + ) + self.service_mock.disable.assert_not_called() + self.service_mock.disable_log_reason.assert_not_called() + self.assertIsNone(result) + + def test_service_set_disable(self): + arglist = [ + '--disable', + self.service.host, + self.service.binary, + ] + verifylist = [ + ('disable', True), + ('host', self.service.host), + ('service', self.service.binary), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + result = self.cmd.take_action(parsed_args) + + self.service_mock.disable.assert_called_with( + self.service.host, + self.service.binary + ) + self.service_mock.enable.assert_not_called() + self.service_mock.disable_log_reason.assert_not_called() + self.assertIsNone(result) + + def test_service_set_disable_with_reason(self): + reason = 'earthquake' + arglist = [ + '--disable', + '--disable-reason', reason, + self.service.host, + self.service.binary, + ] + verifylist = [ + ('disable', True), + ('disable_reason', reason), + ('host', self.service.host), + ('service', self.service.binary), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + result = self.cmd.take_action(parsed_args) + + self.service_mock.disable_log_reason.assert_called_with( + self.service.host, + self.service.binary, + reason + ) + self.assertIsNone(result) + + def test_service_set_only_with_disable_reason(self): + reason = 'earthquake' + arglist = [ + '--disable-reason', reason, + self.service.host, + self.service.binary, + ] + verifylist = [ + ('disable_reason', reason), + ('host', self.service.host), + ('service', self.service.binary), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + try: + self.cmd.take_action(parsed_args) + self.fail("CommandError should be raised.") + except exceptions.CommandError as e: + self.assertEqual("Cannot specify option --disable-reason without " + "--disable specified.", str(e)) + + def test_service_set_enable_with_disable_reason(self): + reason = 'earthquake' + arglist = [ + '--enable', + '--disable-reason', reason, + self.service.host, + self.service.binary, + ] + verifylist = [ + ('enable', True), + ('disable_reason', reason), + ('host', self.service.host), + ('service', self.service.binary), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + try: + self.cmd.take_action(parsed_args) + self.fail("CommandError should be raised.") + except exceptions.CommandError as e: + self.assertEqual("Cannot specify option --disable-reason without " + "--disable specified.", str(e)) diff --git a/openstackclient/tests/volume/v1/test_transfer_request.py b/openstackclient/tests/unit/volume/v1/test_transfer_request.py similarity index 98% rename from openstackclient/tests/volume/v1/test_transfer_request.py rename to openstackclient/tests/unit/volume/v1/test_transfer_request.py index 91f5f4b26a..f7980c34aa 100644 --- a/openstackclient/tests/volume/v1/test_transfer_request.py +++ b/openstackclient/tests/unit/volume/v1/test_transfer_request.py @@ -13,7 +13,7 @@ # -from openstackclient.tests.volume.v1 import fakes as transfer_fakes +from openstackclient.tests.unit.volume.v1 import fakes as transfer_fakes from openstackclient.volume.v1 import volume_transfer_request diff --git a/openstackclient/tests/volume/v1/test_volume.py b/openstackclient/tests/unit/volume/v1/test_volume.py similarity index 99% rename from openstackclient/tests/volume/v1/test_volume.py rename to openstackclient/tests/unit/volume/v1/test_volume.py index e41c2a7266..f90566fd5e 100644 --- a/openstackclient/tests/volume/v1/test_volume.py +++ b/openstackclient/tests/unit/volume/v1/test_volume.py @@ -16,9 +16,9 @@ import copy import mock -from openstackclient.tests import fakes -from openstackclient.tests.identity.v2_0 import fakes as identity_fakes -from openstackclient.tests.volume.v1 import fakes as volume_fakes +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v2_0 import fakes as identity_fakes +from openstackclient.tests.unit.volume.v1 import fakes as volume_fakes from openstackclient.volume.v1 import volume diff --git a/openstackclient/tests/unit/volume/v2/__init__.py b/openstackclient/tests/unit/volume/v2/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openstackclient/tests/volume/v2/fakes.py b/openstackclient/tests/unit/volume/v2/fakes.py similarity index 98% rename from openstackclient/tests/volume/v2/fakes.py rename to openstackclient/tests/unit/volume/v2/fakes.py index 49384bd8ff..a958c46803 100644 --- a/openstackclient/tests/volume/v2/fakes.py +++ b/openstackclient/tests/unit/volume/v2/fakes.py @@ -19,10 +19,10 @@ import uuid from osc_lib import utils as common_utils -from openstackclient.tests import fakes -from openstackclient.tests.identity.v3 import fakes as identity_fakes -from openstackclient.tests.image.v2 import fakes as image_fakes -from openstackclient.tests import utils +from openstackclient.tests.unit import fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit.image.v2 import fakes as image_fakes +from openstackclient.tests.unit import utils class FakeTransfer(object): diff --git a/openstackclient/tests/volume/v2/test_backup.py b/openstackclient/tests/unit/volume/v2/test_backup.py similarity index 99% rename from openstackclient/tests/volume/v2/test_backup.py rename to openstackclient/tests/unit/volume/v2/test_backup.py index 67064352b2..4563387016 100644 --- a/openstackclient/tests/volume/v2/test_backup.py +++ b/openstackclient/tests/unit/volume/v2/test_backup.py @@ -18,7 +18,7 @@ from mock import call from osc_lib import exceptions from osc_lib import utils -from openstackclient.tests.volume.v2 import fakes as volume_fakes +from openstackclient.tests.unit.volume.v2 import fakes as volume_fakes from openstackclient.volume.v2 import backup diff --git a/openstackclient/tests/volume/v2/test_qos_specs.py b/openstackclient/tests/unit/volume/v2/test_qos_specs.py similarity index 99% rename from openstackclient/tests/volume/v2/test_qos_specs.py rename to openstackclient/tests/unit/volume/v2/test_qos_specs.py index 56b8ae03bb..7597e85280 100644 --- a/openstackclient/tests/volume/v2/test_qos_specs.py +++ b/openstackclient/tests/unit/volume/v2/test_qos_specs.py @@ -19,7 +19,7 @@ from mock import call from osc_lib import exceptions from osc_lib import utils -from openstackclient.tests.volume.v2 import fakes as volume_fakes +from openstackclient.tests.unit.volume.v2 import fakes as volume_fakes from openstackclient.volume.v2 import qos_specs diff --git a/openstackclient/tests/volume/v2/test_service.py b/openstackclient/tests/unit/volume/v2/test_service.py similarity index 99% rename from openstackclient/tests/volume/v2/test_service.py rename to openstackclient/tests/unit/volume/v2/test_service.py index 5959a5e3ec..3e9b2df91d 100644 --- a/openstackclient/tests/volume/v2/test_service.py +++ b/openstackclient/tests/unit/volume/v2/test_service.py @@ -14,7 +14,7 @@ from osc_lib import exceptions -from openstackclient.tests.volume.v2 import fakes as service_fakes +from openstackclient.tests.unit.volume.v2 import fakes as service_fakes from openstackclient.volume.v2 import service diff --git a/openstackclient/tests/volume/v2/test_snapshot.py b/openstackclient/tests/unit/volume/v2/test_snapshot.py similarity index 99% rename from openstackclient/tests/volume/v2/test_snapshot.py rename to openstackclient/tests/unit/volume/v2/test_snapshot.py index 3eb740ba6c..333d8d7248 100644 --- a/openstackclient/tests/volume/v2/test_snapshot.py +++ b/openstackclient/tests/unit/volume/v2/test_snapshot.py @@ -19,7 +19,7 @@ from mock import call from osc_lib import exceptions from osc_lib import utils -from openstackclient.tests.volume.v2 import fakes as volume_fakes +from openstackclient.tests.unit.volume.v2 import fakes as volume_fakes from openstackclient.volume.v2 import snapshot diff --git a/openstackclient/tests/volume/v2/test_transfer_request.py b/openstackclient/tests/unit/volume/v2/test_transfer_request.py similarity index 98% rename from openstackclient/tests/volume/v2/test_transfer_request.py rename to openstackclient/tests/unit/volume/v2/test_transfer_request.py index ea39caa729..32108c025d 100644 --- a/openstackclient/tests/volume/v2/test_transfer_request.py +++ b/openstackclient/tests/unit/volume/v2/test_transfer_request.py @@ -13,7 +13,7 @@ # -from openstackclient.tests.volume.v2 import fakes as transfer_fakes +from openstackclient.tests.unit.volume.v2 import fakes as transfer_fakes from openstackclient.volume.v2 import volume_transfer_request diff --git a/openstackclient/tests/volume/v2/test_type.py b/openstackclient/tests/unit/volume/v2/test_type.py similarity index 98% rename from openstackclient/tests/volume/v2/test_type.py rename to openstackclient/tests/unit/volume/v2/test_type.py index b0316aefca..84f87e3b19 100644 --- a/openstackclient/tests/volume/v2/test_type.py +++ b/openstackclient/tests/unit/volume/v2/test_type.py @@ -17,9 +17,9 @@ import mock from osc_lib import exceptions from osc_lib import utils -from openstackclient.tests.identity.v3 import fakes as identity_fakes -from openstackclient.tests import utils as tests_utils -from openstackclient.tests.volume.v2 import fakes as volume_fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit import utils as tests_utils +from openstackclient.tests.unit.volume.v2 import fakes as volume_fakes from openstackclient.volume.v2 import volume_type diff --git a/openstackclient/tests/volume/v2/test_volume.py b/openstackclient/tests/unit/volume/v2/test_volume.py similarity index 99% rename from openstackclient/tests/volume/v2/test_volume.py rename to openstackclient/tests/unit/volume/v2/test_volume.py index 74181a259f..66f8f74d42 100644 --- a/openstackclient/tests/volume/v2/test_volume.py +++ b/openstackclient/tests/unit/volume/v2/test_volume.py @@ -18,9 +18,9 @@ from mock import call from osc_lib import exceptions from osc_lib import utils -from openstackclient.tests.identity.v3 import fakes as identity_fakes -from openstackclient.tests.image.v2 import fakes as image_fakes -from openstackclient.tests.volume.v2 import fakes as volume_fakes +from openstackclient.tests.unit.identity.v3 import fakes as identity_fakes +from openstackclient.tests.unit.image.v2 import fakes as image_fakes +from openstackclient.tests.unit.volume.v2 import fakes as volume_fakes from openstackclient.volume.v2 import volume