def test_failsWithIncorrectDeprecation(self): """ callDeprecated raises a test failure if the callable was deprecated at a different version to the one expected. """ differentVersion = Version("Foo", 1, 2, 3) exception = self.assertRaises(self.failureException, self.callDeprecated, differentVersion, oldMethod, "foo") self.assertIn(getVersionString(self.version), str(exception)) self.assertIn(getVersionString(differentVersion), str(exception))
def test_failsWithIncorrectDeprecation(self): """ callDeprecated raises a test failure if the callable was deprecated at a different version to the one expected. """ differentVersion = Version('Foo', 1, 2, 3) exception = self.assertRaises(self.failureException, self.callDeprecated, differentVersion, self.oldMethod, 'foo') self.assertIn(getVersionString(self.version), str(exception)) self.assertIn(getVersionString(differentVersion), str(exception))
def test_callDeprecationWithWrongMessage(self): """ If the message passed to L{callDeprecated} doesn't match, L{callDeprecated} raises a test failure. """ exception = self.assertRaises( self.failureException, self.callDeprecated, (self.version, "something.wrong"), oldMethodReplaced, 1 ) self.assertIn(getVersionString(self.version), str(exception)) self.assertIn("please use newMethod instead", str(exception))
def test_callDeprecationWithWrongMessage(self): """ If the message passed to L{callDeprecated} doesn't match, L{callDeprecated} raises a test failure. """ exception = self.assertRaises(self.failureException, self.callDeprecated, (self.version, "something.wrong"), oldMethodReplaced, 1) self.assertIn(getVersionString(self.version), str(exception)) self.assertIn("please use newMethod instead", str(exception))