improved internal proxy tests and changed internal_proxy.get_container_list

This commit is contained in:
John Dickinson 2011-03-08 10:46:53 -06:00
parent 5a050612c6
commit 6aaa48540f
2 changed files with 2 additions and 2 deletions

View File

@ -204,7 +204,7 @@ class InternalProxy(object):
req = webob.Request.blank(path, environ={'REQUEST_METHOD': 'GET'})
resp = self._handle_request(req)
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:
return []
return json_loads(resp.body)

View File

@ -174,7 +174,7 @@ class TestInternalProxy(unittest.TestCase):
status_codes)
p = internal_proxy.InternalProxy()
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)
def test_upload_file_with_retries(self):