improved internal proxy tests and changed internal_proxy.get_container_list
This commit is contained in:
parent
5a050612c6
commit
6aaa48540f
@ -204,7 +204,7 @@ class InternalProxy(object):
|
|||||||
req = webob.Request.blank(path, environ={'REQUEST_METHOD': 'GET'})
|
req = webob.Request.blank(path, environ={'REQUEST_METHOD': 'GET'})
|
||||||
resp = self._handle_request(req)
|
resp = self._handle_request(req)
|
||||||
if resp.status_int < 200 or resp.status_int >= 300:
|
if resp.status_int < 200 or resp.status_int >= 300:
|
||||||
raise Exception('Request: %s\nResponse: %s' % (req, resp))
|
return [] # TODO: distinguish between 404 and empty container
|
||||||
if resp.status_int == 204:
|
if resp.status_int == 204:
|
||||||
return []
|
return []
|
||||||
return json_loads(resp.body)
|
return json_loads(resp.body)
|
||||||
|
@ -174,7 +174,7 @@ class TestInternalProxy(unittest.TestCase):
|
|||||||
status_codes)
|
status_codes)
|
||||||
p = internal_proxy.InternalProxy()
|
p = internal_proxy.InternalProxy()
|
||||||
with tempfile.NamedTemporaryFile() as file_obj:
|
with tempfile.NamedTemporaryFile() as file_obj:
|
||||||
resp = p.upload_file(file_obj, 'a', 'c', 'o')
|
resp = p.upload_file(file_obj.name, 'a', 'c', 'o')
|
||||||
self.assertTrue(resp)
|
self.assertTrue(resp)
|
||||||
|
|
||||||
def test_upload_file_with_retries(self):
|
def test_upload_file_with_retries(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user