summaryrefslogtreecommitdiff
path: root/tests/test_swiftclient.py
diff options
context:
space:
mode:
authorSteven Hardy <shardy@redhat.com>2012-10-23 09:18:29 +0100
committerSteven Hardy <shardy@redhat.com>2012-10-24 22:40:31 +0100
commit656b80bef38db8eda148288a4cb5c9fbd3a0da4b (patch)
tree1bffcd207448added8a836882207be53758bd3bf /tests/test_swiftclient.py
parent2be776c2e543dcafbe268b9f18e17f08a5e1466f (diff)
downloadpython-swiftclient-656b80bef38db8eda148288a4cb5c9fbd3a0da4b.tar.gz
swiftclient Connection : default optional arguments to None
Default the authurl/user/key constructor arguments for the Connection class to None, as these are not required in the preauthurl/preauthtoken case Change-Id: I445a5d365212c365ecc691c0a670a226e2b7954a
Diffstat (limited to 'tests/test_swiftclient.py')
-rw-r--r--tests/test_swiftclient.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_swiftclient.py b/tests/test_swiftclient.py
index 80e7a22..121456c 100644
--- a/tests/test_swiftclient.py
+++ b/tests/test_swiftclient.py
@@ -407,6 +407,20 @@ class TestConnection(MockHttpTest):
conn = c.Connection('http://www.test.com', 'asdf', 'asdf')
self.assertEquals(conn.retries, 5)
+ def test_instance_kwargs(self):
+ args = {'user': 'ausername',
+ 'key': 'secretpass',
+ 'authurl': 'http://www.test.com',
+ 'tenant_name': 'atenant'}
+ conn = c.Connection(**args)
+ self.assertEquals(type(conn), c.Connection)
+
+ def test_instance_kwargs_token(self):
+ args = {'preauthtoken': 'atoken123',
+ 'preauthurl': 'http://www.test.com:8080/v1/AUTH_123456'}
+ conn = c.Connection(**args)
+ self.assertEquals(type(conn), c.Connection)
+
def test_retry(self):
c.http_connection = self.fake_http_connection(500)