diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2013-11-20 18:02:09 -0600 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2013-11-21 01:27:10 -0600 |
| commit | 9062811d10f2ab660ce38f9bd20be9c52daa9479 (patch) | |
| tree | d01b271b1ae7c968c1c009cd6f7dada5ef1a3a37 /openstackclient/tests/object/v1/lib/test_object.py | |
| parent | d45187a0c163187649e29931d21c4607379d1e73 (diff) | |
| download | python-openstackclient-9062811d10f2ab660ce38f9bd20be9c52daa9479.tar.gz | |
Expand support for command extensions
Allows client libraries to have complete access to the rest of the
OSC ClientManager. In addition, extension libraries can define
global options (for API version options/env vars) and define
versioned API entry points similar to the in-repo commands.
The changes to ClientManager exposed some issues in the existing
object api tests that needed to be cleaned up.
Change-Id: Ic9662edf34c5dd130a2f1a69d2454adefc1f8a95
Diffstat (limited to 'openstackclient/tests/object/v1/lib/test_object.py')
| -rw-r--r-- | openstackclient/tests/object/v1/lib/test_object.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/openstackclient/tests/object/v1/lib/test_object.py b/openstackclient/tests/object/v1/lib/test_object.py index 0104183e..ef93877a 100644 --- a/openstackclient/tests/object/v1/lib/test_object.py +++ b/openstackclient/tests/object/v1/lib/test_object.py @@ -19,8 +19,7 @@ import mock from openstackclient.object.v1.lib import object as lib_object from openstackclient.tests.common import test_restapi as restapi -from openstackclient.tests import fakes -from openstackclient.tests import utils +from openstackclient.tests.object.v1 import fakes as object_fakes fake_account = 'q12we34r' @@ -37,12 +36,10 @@ class FakeClient(object): self.token = fake_auth -class TestObject(utils.TestCommand): +class TestObject(object_fakes.TestObjectv1): def setUp(self): super(TestObject, self).setUp() - self.app.client_manager = fakes.FakeClientManager() - self.app.client_manager.object = FakeClient() self.app.restapi = mock.MagicMock() @@ -54,7 +51,7 @@ class TestObjectListObjects(TestObject): data = lib_object.list_objects( self.app.restapi, - self.app.client_manager.object.endpoint, + fake_url, fake_container, ) @@ -71,7 +68,7 @@ class TestObjectListObjects(TestObject): data = lib_object.list_objects( self.app.restapi, - self.app.client_manager.object.endpoint, + fake_url, fake_container, marker='next', ) @@ -89,7 +86,7 @@ class TestObjectListObjects(TestObject): data = lib_object.list_objects( self.app.restapi, - self.app.client_manager.object.endpoint, + fake_url, fake_container, limit=5, ) @@ -107,7 +104,7 @@ class TestObjectListObjects(TestObject): data = lib_object.list_objects( self.app.restapi, - self.app.client_manager.object.endpoint, + fake_url, fake_container, end_marker='last', ) @@ -125,7 +122,7 @@ class TestObjectListObjects(TestObject): data = lib_object.list_objects( self.app.restapi, - self.app.client_manager.object.endpoint, + fake_url, fake_container, delimiter='|', ) @@ -146,7 +143,7 @@ class TestObjectListObjects(TestObject): data = lib_object.list_objects( self.app.restapi, - self.app.client_manager.object.endpoint, + fake_url, fake_container, prefix='foo/', ) @@ -164,7 +161,7 @@ class TestObjectListObjects(TestObject): data = lib_object.list_objects( self.app.restapi, - self.app.client_manager.object.endpoint, + fake_url, fake_container, path='next', ) @@ -192,7 +189,7 @@ class TestObjectListObjects(TestObject): data = lib_object.list_objects( self.app.restapi, - self.app.client_manager.object.endpoint, + fake_url, fake_container, full_listing=True, ) @@ -216,7 +213,7 @@ class TestObjectShowObjects(TestObject): data = lib_object.show_object( self.app.restapi, - self.app.client_manager.object.endpoint, + fake_url, fake_container, fake_object, ) @@ -250,7 +247,7 @@ class TestObjectShowObjects(TestObject): data = lib_object.show_object( self.app.restapi, - self.app.client_manager.object.endpoint, + fake_url, fake_container, fake_object, ) |
