From 75086a13301f20a1f459cf2dbd684bc8a06726bb Mon Sep 17 00:00:00 2001 From: Pete Zaitcev Date: Sat, 14 Sep 2013 16:09:53 -0600 Subject: [PATCH] Supply correct arguments to __init__ of a base class Hopefuly this extra test case is not too inane and slows us down for nothing. It is verified to fail with the old code. Change-Id: I604eca09f7f9ae044a8ad75284cd82a37325f99c --- swift/common/internal_client.py | 2 +- test/unit/common/test_internal_client.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/swift/common/internal_client.py b/swift/common/internal_client.py index e56f391695..ff2bc67d51 100644 --- a/swift/common/internal_client.py +++ b/swift/common/internal_client.py @@ -36,7 +36,7 @@ class UnexpectedResponse(Exception): """ def __init__(self, message, resp): - super(UnexpectedResponse, self).__init__(self, message) + super(UnexpectedResponse, self).__init__(message) self.resp = resp diff --git a/test/unit/common/test_internal_client.py b/test/unit/common/test_internal_client.py index 4c021b8d67..f4d2504c8e 100644 --- a/test/unit/common/test_internal_client.py +++ b/test/unit/common/test_internal_client.py @@ -291,6 +291,12 @@ class TestInternalClient(unittest.TestCase): except Exception as err: pass self.assertEquals(200, err.resp.status_int) + try: + client.make_request('GET', '/', {}, (111,)) + except Exception as err: + self.assertTrue(str(err).startswith('Unexpected response')) + else: + self.fail("Expected the UnexpectedResponse") finally: internal_client.sleep = old_sleep