Index: third_party/gsutil/third_party/boto/tests/unit/sts/test_credentials.py |
diff --git a/third_party/gsutil/third_party/boto/tests/unit/sts/test_credentials.py b/third_party/gsutil/third_party/boto/tests/unit/sts/test_credentials.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..27a16ca72a81b02960376ccf700d76b128e67668 |
--- /dev/null |
+++ b/third_party/gsutil/third_party/boto/tests/unit/sts/test_credentials.py |
@@ -0,0 +1,38 @@ |
+import unittest |
+ |
+from boto.sts.credentials import Credentials |
+ |
+ |
+class STSCredentialsTest(unittest.TestCase): |
+ sts = True |
+ |
+ def setUp(self): |
+ super(STSCredentialsTest, self).setUp() |
+ self.creds = Credentials() |
+ |
+ def test_to_dict(self): |
+ # This would fail miserably if ``Credentials.request_id`` hadn't been |
+ # explicitly set (no default). |
+ # Default. |
+ self.assertEqual(self.creds.to_dict(), { |
+ 'access_key': None, |
+ 'expiration': None, |
+ 'request_id': None, |
+ 'secret_key': None, |
+ 'session_token': None |
+ }) |
+ |
+ # Override. |
+ creds = Credentials() |
+ creds.access_key = 'something' |
+ creds.secret_key = 'crypto' |
+ creds.session_token = 'this' |
+ creds.expiration = 'way' |
+ creds.request_id = 'comes' |
+ self.assertEqual(creds.to_dict(), { |
+ 'access_key': 'something', |
+ 'expiration': 'way', |
+ 'request_id': 'comes', |
+ 'secret_key': 'crypto', |
+ 'session_token': 'this' |
+ }) |