コード例 #1
0
 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))
コード例 #2
0
ファイル: test_assertions.py プロジェクト: swift1911/twisted
 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))
コード例 #3
0
 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))
コード例 #4
0
ファイル: test_assertions.py プロジェクト: neogan74/twisted
 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))