summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/image/v1/fakes.py
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2021-11-17 10:55:33 +0000
committerStephen Finucane <sfinucan@redhat.com>2021-11-17 11:42:07 +0000
commit1feb676469f7ccd6a022027bf2e1ecee9cf6d548 (patch)
tree1c1e40f71d51a5f5bdce1476df168beea7bb682b /openstackclient/tests/unit/image/v1/fakes.py
parent2135a9ea05c79a11185ca87f6bb5ade3b71501bb (diff)
downloadpython-openstackclient-1feb676469f7ccd6a022027bf2e1ecee9cf6d548.tar.gz
tests: Update fake image client in tests
These clients are intended to fake out the old glanceclient client which we no longer use. They were only "working" because we weren't actually using any of the glancelclient-based stuff and were instead overriding everything within the tests. Move these overrides back to the main fake client and remove the crud. Change-Id: I92ee74a1df72a6dd23f9d2dc04342aab0cbd3210 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient/tests/unit/image/v1/fakes.py')
-rw-r--r--openstackclient/tests/unit/image/v1/fakes.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/openstackclient/tests/unit/image/v1/fakes.py b/openstackclient/tests/unit/image/v1/fakes.py
index 3097a42f..164050c0 100644
--- a/openstackclient/tests/unit/image/v1/fakes.py
+++ b/openstackclient/tests/unit/image/v1/fakes.py
@@ -22,11 +22,11 @@ from openstackclient.tests.unit import utils
from openstackclient.tests.unit.volume.v1 import fakes as volume_fakes
-class FakeImagev1Client(object):
+class FakeImagev1Client:
def __init__(self, **kwargs):
self.images = mock.Mock()
- self.images.resource_class = fakes.FakeResource(None, {})
+
self.auth_token = kwargs['token']
self.management_url = kwargs['endpoint']
self.version = 1.0
@@ -35,7 +35,7 @@ class FakeImagev1Client(object):
class TestImagev1(utils.TestCommand):
def setUp(self):
- super(TestImagev1, self).setUp()
+ super().setUp()
self.app.client_manager.image = FakeImagev1Client(
endpoint=fakes.AUTH_URL,
@@ -46,6 +46,8 @@ class TestImagev1(utils.TestCommand):
token=fakes.AUTH_TOKEN,
)
+ self.client = self.app.client_manager.image
+
def create_one_image(attrs=None):
"""Create a fake image.