From 6aaa48540f7a96533350c279ad5fdcc837e9e162 Mon Sep 17 00:00:00 2001 From: John Dickinson Date: Tue, 8 Mar 2011 10:46:53 -0600 Subject: [PATCH] improved internal proxy tests and changed internal_proxy.get_container_list --- swift/common/internal_proxy.py | 2 +- test/unit/common/test_internal_proxy.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/swift/common/internal_proxy.py b/swift/common/internal_proxy.py index e77a619bf0..dd62ba1b0d 100644 --- a/swift/common/internal_proxy.py +++ b/swift/common/internal_proxy.py @@ -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) diff --git a/test/unit/common/test_internal_proxy.py b/test/unit/common/test_internal_proxy.py index 6a99d5fcf0..a2e82f8d31 100644 --- a/test/unit/common/test_internal_proxy.py +++ b/test/unit/common/test_internal_proxy.py @@ -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):