summaryrefslogtreecommitdiff
path: root/tests/unit/test_swiftclient.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/test_swiftclient.py')
-rw-r--r--tests/unit/test_swiftclient.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/tests/unit/test_swiftclient.py b/tests/unit/test_swiftclient.py
index 7e753e9..7d0dd9a 100644
--- a/tests/unit/test_swiftclient.py
+++ b/tests/unit/test_swiftclient.py
@@ -582,6 +582,7 @@ class TestGetAccount(MockHttpTest):
self.assertEqual(value, [])
self.assertRequests([
('GET', '/v1/acct?format=json', '', {
+ 'accept-encoding': 'gzip',
'x-auth-token': 'asdf'}),
])
@@ -592,6 +593,7 @@ class TestGetAccount(MockHttpTest):
c.get_account('http://www.test.com/v1/acct', 'asdf', marker='marker')
self.assertRequests([
('GET', '/v1/acct?format=json&marker=marker', '', {
+ 'accept-encoding': 'gzip',
'x-auth-token': 'asdf'}),
])
@@ -602,6 +604,7 @@ class TestGetAccount(MockHttpTest):
c.get_account('http://www.test.com/v1/acct', 'asdf', limit=10)
self.assertRequests([
('GET', '/v1/acct?format=json&limit=10', '', {
+ 'accept-encoding': 'gzip',
'x-auth-token': 'asdf'}),
])
@@ -612,6 +615,7 @@ class TestGetAccount(MockHttpTest):
c.get_account('http://www.test.com/v1/acct', 'asdf', prefix='asdf/')
self.assertRequests([
('GET', '/v1/acct?format=json&prefix=asdf/', '', {
+ 'accept-encoding': 'gzip',
'x-auth-token': 'asdf'}),
])
@@ -623,6 +627,7 @@ class TestGetAccount(MockHttpTest):
end_marker='end_marker')
self.assertRequests([
('GET', '/v1/acct?format=json&end_marker=end_marker', '', {
+ 'accept-encoding': 'gzip',
'x-auth-token': 'asdf'}),
])
@@ -701,6 +706,7 @@ class TestGetContainer(MockHttpTest):
self.assertEqual(value, [])
self.assertRequests([
('GET', '/v1/acct/container?format=json', '', {
+ 'accept-encoding': 'gzip',
'x-auth-token': 'token'}),
])
@@ -712,6 +718,7 @@ class TestGetContainer(MockHttpTest):
marker='marker')
self.assertRequests([
('GET', '/v1/acct/container?format=json&marker=marker', '', {
+ 'accept-encoding': 'gzip',
'x-auth-token': 'token'}),
])
@@ -723,6 +730,7 @@ class TestGetContainer(MockHttpTest):
limit=10)
self.assertRequests([
('GET', '/v1/acct/container?format=json&limit=10', '', {
+ 'accept-encoding': 'gzip',
'x-auth-token': 'token'}),
])
@@ -734,6 +742,7 @@ class TestGetContainer(MockHttpTest):
prefix='asdf/')
self.assertRequests([
('GET', '/v1/acct/container?format=json&prefix=asdf/', '', {
+ 'accept-encoding': 'gzip',
'x-auth-token': 'token'}),
])
@@ -745,6 +754,7 @@ class TestGetContainer(MockHttpTest):
delimiter='/')
self.assertRequests([
('GET', '/v1/acct/container?format=json&delimiter=/', '', {
+ 'accept-encoding': 'gzip',
'x-auth-token': 'token'}),
])
@@ -756,7 +766,7 @@ class TestGetContainer(MockHttpTest):
end_marker='end_marker')
self.assertRequests([
('GET', '/v1/acct/container?format=json&end_marker=end_marker',
- '', {'x-auth-token': 'token'}),
+ '', {'x-auth-token': 'token', 'accept-encoding': 'gzip'}),
])
def test_param_path(self):
@@ -767,6 +777,7 @@ class TestGetContainer(MockHttpTest):
path='asdf')
self.assertRequests([
('GET', '/v1/acct/container?format=json&path=asdf', '', {
+ 'accept-encoding': 'gzip',
'x-auth-token': 'token'}),
])
@@ -781,6 +792,7 @@ class TestGetContainer(MockHttpTest):
('GET', '/container?format=json', '', {
'x-auth-token': 'TOKEN',
'x-client-key': 'client key',
+ 'accept-encoding': 'gzip',
}),
])
@@ -791,6 +803,7 @@ class TestGetContainer(MockHttpTest):
query_string="hello=20")
self.assertRequests([
('GET', '/asdf?format=json&hello=20', '', {
+ 'accept-encoding': 'gzip',
'x-auth-token': 'asdf'}),
])
@@ -1584,7 +1597,7 @@ class TestGetCapabilities(MockHttpTest):
http_conn = conn('http://www.test.com/info')
info = c.get_capabilities(http_conn)
self.assertRequests([
- ('GET', '/info', '', {}),
+ ('GET', '/info', '', {'Accept-Encoding': 'gzip'}),
])
self.assertEqual(info, {})
self.assertTrue(http_conn[1].resp.has_been_read)
@@ -1620,7 +1633,8 @@ class TestGetCapabilities(MockHttpTest):
('GET', '/auth/v1.0', '', {
'x-auth-user': 'user',
'x-auth-key': 'key'}),
- ('GET', 'http://storage.example.com/info', '', {}),
+ ('GET', 'http://storage.example.com/info', '', {
+ 'accept-encoding': 'gzip'}),
])
def test_conn_get_capabilities_with_os_auth(self):
@@ -2342,6 +2356,7 @@ class TestConnection(MockHttpTest):
('GET', '/v1/a/c1?format=json&limit=5&prefix=p', '', {
'x-auth-token': 'token',
'X-Favourite-Pet': 'Aardvark',
+ 'accept-encoding': 'gzip',
}),
])
self.assertEqual(conn.attempts, 1)