811
811
self.assertEndsWith('foo', 'oo')
812
812
self.assertRaises(AssertionError, self.assertEndsWith, 'o', 'oo')
814
def test_assertDeprecated(self):
814
def test_callDeprecated(self):
815
815
def testfunc(be_deprecated, result=None):
816
816
if be_deprecated is True:
817
817
symbol_versioning.warn('i am deprecated', DeprecationWarning,
820
result = self.assertDeprecated(['i am deprecated'], testfunc, True)
820
result = self.callDeprecated(['i am deprecated'], testfunc, True)
821
821
self.assertIs(None, result)
822
result = self.assertDeprecated([], testfunc, False, 'result')
822
result = self.callDeprecated([], testfunc, False, 'result')
823
823
self.assertEqual('result', result)
824
self.assertDeprecated(['i am deprecated'], testfunc,
824
self.callDeprecated(['i am deprecated'], testfunc,
825
825
be_deprecated=True)
826
self.assertDeprecated([], testfunc, be_deprecated=False)
826
self.callDeprecated([], testfunc, be_deprecated=False)
829
829
class TestConvenienceMakers(TestCaseWithTransport):