summaryrefslogtreecommitdiff
path: root/tests/test_swiftclient.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_swiftclient.py')
-rw-r--r--tests/test_swiftclient.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test_swiftclient.py b/tests/test_swiftclient.py
index 8e42fc9..d5a3caa 100644
--- a/tests/test_swiftclient.py
+++ b/tests/test_swiftclient.py
@@ -265,6 +265,35 @@ class TestGetAuth(MockHttpTest):
os_options={},
auth_version='2.0')
+ def test_auth_v2_insecure(self):
+ os_options = {'tenant_name': 'foo'}
+ c.get_keystoneclient_2_0 = fake_get_keystoneclient_2_0(
+ os_options,
+ None)
+
+ auth_url_secure = 'https://www.tests.com'
+ auth_url_insecure = 'https://www.tests.com/invalid-certificate'
+
+ url, token = c.get_auth(auth_url_secure, 'asdf', 'asdf',
+ os_options=os_options, auth_version='2.0')
+ self.assertTrue(url.startswith("http"))
+ self.assertTrue(token)
+
+ url, token = c.get_auth(auth_url_insecure, 'asdf', 'asdf',
+ os_options=os_options, auth_version='2.0',
+ insecure=True)
+ self.assertTrue(url.startswith("http"))
+ self.assertTrue(token)
+
+ self.assertRaises(c.ClientException, c.get_auth,
+ auth_url_insecure, 'asdf', 'asdf',
+ os_options=os_options, auth_version='2.0')
+ self.assertRaises(c.ClientException, c.get_auth,
+ auth_url_insecure, 'asdf', 'asdf',
+ os_options=os_options, auth_version='2.0',
+ insecure=False)
+
+
class TestGetAccount(MockHttpTest):
def test_no_content(self):