Remove unused AdjustedBaseAuthTokenMiddlewareTest
assertDictEqual isn't used, and the assertIsInstance message should be consistent across versions. This leaves nothing in AdjustedBaseAuthTokenMiddlewareTest so remove it. Change-Id: I7d338c9b66c77ff81a79d1a1d5c8ebcc3dd300a2
This commit is contained in:
parent
c00ef0e751
commit
9b1feca895
@ -315,33 +315,6 @@ class BaseAuthTokenMiddlewareTest(testtools.TestCase):
|
||||
self.assertIsInstance(httpretty.last_request(),
|
||||
httpretty.core.HTTPrettyRequestEmpty)
|
||||
|
||||
if tuple(sys.version_info)[0:2] < (2, 7):
|
||||
|
||||
# 2.6 doesn't have the assert dict equals so make sure that it exists
|
||||
class AdjustedBaseAuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest):
|
||||
def assertIsInstance(self, obj, cls, msg=None):
|
||||
"""Same as self.assertTrue(isinstance(obj, cls)), with a nicer
|
||||
default message.
|
||||
"""
|
||||
if not isinstance(obj, cls):
|
||||
standardMsg = '%s is not an instance of %r' % (obj, cls)
|
||||
self.fail(self._formatMessage(msg, standardMsg))
|
||||
|
||||
def assertDictEqual(self, d1, d2, msg=None):
|
||||
# Simple version taken from 2.7
|
||||
self.assertIsInstance(d1, dict,
|
||||
'First argument is not a dictionary')
|
||||
self.assertIsInstance(d2, dict,
|
||||
'Second argument is not a dictionary')
|
||||
if d1 != d2:
|
||||
if msg:
|
||||
self.fail(msg)
|
||||
else:
|
||||
standardMsg = '%r != %r' % (d1, d2)
|
||||
self.fail(standardMsg)
|
||||
|
||||
BaseAuthTokenMiddlewareTest = AdjustedBaseAuthTokenMiddlewareTest
|
||||
|
||||
|
||||
class MultiStepAuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest,
|
||||
testresources.ResourcedTestCase):
|
||||
|
Loading…
x
Reference in New Issue
Block a user