diff --git a/openstackclient/tests/volume/v1/fakes.py b/openstackclient/tests/volume/v1/fakes.py index 2584d4b10d..b96f925dce 100644 --- a/openstackclient/tests/volume/v1/fakes.py +++ b/openstackclient/tests/volume/v1/fakes.py @@ -129,25 +129,6 @@ QOS_WITH_ASSOCIATIONS = { } -class FakeTransferClient(object): - - def __init__(self, **kwargs): - - self.transfers = mock.Mock() - self.transfers.resource_class = fakes.FakeResource(None, {}) - - -class TestTransfer(utils.TestCommand): - - def setUp(self): - super(TestTransfer, self).setUp() - - self.app.client_manager.volume = FakeTransferClient( - endpoint=fakes.AUTH_URL, - token=fakes.AUTH_TOKEN - ) - - class FakeTransfer(object): """Fake one or more Transfer.""" @@ -180,24 +161,6 @@ class FakeTransfer(object): return transfer -class FakeServiceClient(object): - - def __init__(self, **kwargs): - self.services = mock.Mock() - self.services.resource_class = fakes.FakeResource(None, {}) - - -class TestService(utils.TestCommand): - - def setUp(self): - super(TestService, self).setUp() - - self.app.client_manager.volume = FakeServiceClient( - endpoint=fakes.AUTH_URL, - token=fakes.AUTH_TOKEN - ) - - class FakeService(object): """Fake one or more Services.""" @@ -290,6 +253,8 @@ class FakeVolumev1Client(object): self.qos_specs.resource_class = fakes.FakeResource(None, {}) self.volume_types = mock.Mock() self.volume_types.resource_class = fakes.FakeResource(None, {}) + self.transfers = mock.Mock() + self.transfers.resource_class = fakes.FakeResource(None, {}) self.auth_token = kwargs['token'] self.management_url = kwargs['endpoint'] diff --git a/openstackclient/tests/volume/v1/test_service.py b/openstackclient/tests/volume/v1/test_service.py index 2578d76b59..273a1156b5 100644 --- a/openstackclient/tests/volume/v1/test_service.py +++ b/openstackclient/tests/volume/v1/test_service.py @@ -18,7 +18,7 @@ from openstackclient.tests.volume.v1 import fakes as service_fakes from openstackclient.volume.v1 import service -class TestService(service_fakes.TestService): +class TestService(service_fakes.TestVolumev1): def setUp(self): super(TestService, self).setUp() diff --git a/openstackclient/tests/volume/v1/test_transfer_request.py b/openstackclient/tests/volume/v1/test_transfer_request.py index 94e02d62c9..91f5f4b26a 100644 --- a/openstackclient/tests/volume/v1/test_transfer_request.py +++ b/openstackclient/tests/volume/v1/test_transfer_request.py @@ -17,7 +17,7 @@ from openstackclient.tests.volume.v1 import fakes as transfer_fakes from openstackclient.volume.v1 import volume_transfer_request -class TestTransfer(transfer_fakes.TestTransfer): +class TestTransfer(transfer_fakes.TestVolumev1): def setUp(self): super(TestTransfer, self).setUp() diff --git a/openstackclient/tests/volume/v2/fakes.py b/openstackclient/tests/volume/v2/fakes.py index 6809bebd3f..49384bd8ff 100644 --- a/openstackclient/tests/volume/v2/fakes.py +++ b/openstackclient/tests/volume/v2/fakes.py @@ -25,25 +25,6 @@ from openstackclient.tests.image.v2 import fakes as image_fakes from openstackclient.tests import utils -class FakeTransferClient(object): - - def __init__(self, **kwargs): - - self.transfers = mock.Mock() - self.transfers.resource_class = fakes.FakeResource(None, {}) - - -class TestTransfer(utils.TestCommand): - - def setUp(self): - super(TestTransfer, self).setUp() - - self.app.client_manager.volume = FakeTransferClient( - endpoint=fakes.AUTH_URL, - token=fakes.AUTH_TOKEN - ) - - class FakeTransfer(object): """Fake one or more Transfer.""" @@ -108,24 +89,6 @@ class FakeTypeAccess(object): return type_access -class FakeServiceClient(object): - - def __init__(self, **kwargs): - self.services = mock.Mock() - self.services.resource_class = fakes.FakeResource(None, {}) - - -class TestService(utils.TestCommand): - - def setUp(self): - super(TestService, self).setUp() - - self.app.client_manager.volume = FakeServiceClient( - endpoint=fakes.AUTH_URL, - token=fakes.AUTH_TOKEN - ) - - class FakeService(object): """Fake one or more Services.""" @@ -200,6 +163,10 @@ class FakeVolumeClient(object): self.qos_specs.resource_class = fakes.FakeResource(None, {}) self.availability_zones = mock.Mock() self.availability_zones.resource_class = fakes.FakeResource(None, {}) + self.transfers = mock.Mock() + self.transfers.resource_class = fakes.FakeResource(None, {}) + self.services = mock.Mock() + self.services.resource_class = fakes.FakeResource(None, {}) self.auth_token = kwargs['token'] self.management_url = kwargs['endpoint'] diff --git a/openstackclient/tests/volume/v2/test_service.py b/openstackclient/tests/volume/v2/test_service.py index 2c432b2b2a..5959a5e3ec 100644 --- a/openstackclient/tests/volume/v2/test_service.py +++ b/openstackclient/tests/volume/v2/test_service.py @@ -18,7 +18,7 @@ from openstackclient.tests.volume.v2 import fakes as service_fakes from openstackclient.volume.v2 import service -class TestService(service_fakes.TestService): +class TestService(service_fakes.TestVolume): def setUp(self): super(TestService, self).setUp() diff --git a/openstackclient/tests/volume/v2/test_transfer_request.py b/openstackclient/tests/volume/v2/test_transfer_request.py index 945833c939..ea39caa729 100644 --- a/openstackclient/tests/volume/v2/test_transfer_request.py +++ b/openstackclient/tests/volume/v2/test_transfer_request.py @@ -17,7 +17,7 @@ from openstackclient.tests.volume.v2 import fakes as transfer_fakes from openstackclient.volume.v2 import volume_transfer_request -class TestTransfer(transfer_fakes.TestTransfer): +class TestTransfer(transfer_fakes.TestVolume): def setUp(self): super(TestTransfer, self).setUp()