Merge "Supply correct arguments to __init__ of a base class"

This commit is contained in:
Jenkins 2013-09-16 17:17:33 +00:00 committed by Gerrit Code Review
commit 0192a62212
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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