summaryrefslogtreecommitdiff
path: root/tests/test_https.py
diff options
context:
space:
mode:
authorlin-hua-cheng <lin-hua.cheng@hp.com>2013-02-13 22:52:05 -0600
committerLin Hua Cheng <lin-hua.cheng@hp.com>2013-06-20 23:28:31 -0700
commit2239c3b27c657dc0ffe2dbd0f95325e0ed7ae7c5 (patch)
tree9972797a6e5bd27f6262d86d01f9f50d95264ff7 /tests/test_https.py
parentabe6781913a7a4e376c0798e2e962ef16e9a48e6 (diff)
downloadpython-keystoneclient-2239c3b27c657dc0ffe2dbd0f95325e0ed7ae7c5.tar.gz
Implements v3 auth client.
Added support for domain scoping. Enhancement on AccessInfo to support reading v2/v3 token information. Enhancement on ServiceCatalog for reading/filtering v2/v3 service catalog information. Change-Id: Ibb678b9933d3673e37d0fba857a152a3c5d2b4f4
Diffstat (limited to 'tests/test_https.py')
-rw-r--r--tests/test_https.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_https.py b/tests/test_https.py
index bef1db4..4070df9 100644
--- a/tests/test_https.py
+++ b/tests/test_https.py
@@ -68,3 +68,27 @@ class ClientTest(utils.TestCase):
headers=headers,
data='[1, 2, 3]',
**kwargs)
+
+ def test_post_auth(self):
+ with mock.patch.object(requests, "request", MOCK_REQUEST):
+ cl = client.HTTPClient(
+ username="username", password="password", tenant_id="tenant",
+ auth_url="auth_test", cacert="ca.pem", key="key.pem",
+ cert="cert.pem")
+ cl.management_url = "https://127.0.0.1:5000"
+ cl.auth_token = "token"
+ cl.post("/hi", body=[1, 2, 3])
+ headers = {
+ "X-Auth-Token": "token",
+ "Content-Type": "application/json",
+ "User-Agent": cl.USER_AGENT
+ }
+ kwargs = copy.copy(self.TEST_REQUEST_BASE)
+ kwargs['cert'] = ('cert.pem', 'key.pem')
+ kwargs['verify'] = 'ca.pem'
+ MOCK_REQUEST.assert_called_with(
+ "POST",
+ "https://127.0.0.1:5000/hi",
+ headers=headers,
+ data='[1, 2, 3]',
+ **kwargs)