diff options
author | Chmouel Boudjnah <chmouel@enovance.com> | 2013-02-19 12:03:47 +0100 |
---|---|---|
committer | Chmouel Boudjnah <chmouel@enovance.com> | 2013-02-25 01:18:05 +0100 |
commit | ad7e1c26414b8fb1016c86eeffbbf85111df9a15 (patch) | |
tree | 8cc1307617f9a85732c973ff63e982dca1e1d634 /keystone/middleware | |
parent | 557cb9411ae0465fceacc0fd3d8ff985a0451837 (diff) | |
download | keystone-ad7e1c26414b8fb1016c86eeffbbf85111df9a15.tar.gz keystone-ad7e1c26414b8fb1016c86eeffbbf85111df9a15.tar.xz keystone-ad7e1c26414b8fb1016c86eeffbbf85111df9a15.zip |
Rework S3Token middleware tests.
- Split between good and bad tests.
- Add more tests to get to 100% coverage.
Change-Id: Iffd00c2b557e54b122f29f8b0ec7f7ab7a92d16e
Diffstat (limited to 'keystone/middleware')
-rw-r--r-- | keystone/middleware/s3_token.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/keystone/middleware/s3_token.py b/keystone/middleware/s3_token.py index 6c39b9d5..74be5864 100644 --- a/keystone/middleware/s3_token.py +++ b/keystone/middleware/s3_token.py @@ -85,15 +85,14 @@ class S3Token(object): def _json_request(self, creds_json): headers = {'Content-Type': 'application/json'} - + if self.auth_protocol == 'http': + conn = self.http_client_class(self.auth_host, self.auth_port) + else: + conn = self.http_client_class(self.auth_host, + self.auth_port, + self.key_file, + self.cert_file) try: - if self.auth_protocol == 'http': - conn = self.http_client_class(self.auth_host, self.auth_port) - else: - conn = self.http_client_class(self.auth_host, - self.auth_port, - self.key_file, - self.cert_file) conn.request('POST', '/v2.0/s3tokens', body=creds_json, headers=headers) |