Exemplo n.º 1
0
 def test_getDeprecationDocstring(self):
     """
     L{_getDeprecationDocstring} returns a note about the deprecation to go
     into a docstring.
     """
     version = Version('Twisted', 8, 0, 0)
     self.assertEqual(
         "Deprecated in Twisted 8.0.0.", _getDeprecationDocstring(version))
Exemplo n.º 2
0
 def test_getDeprecationDocstring(self):
     """
     L{_getDeprecationDocstring} returns a note about the deprecation to go
     into a docstring.
     """
     version = Version('Twisted', 8, 0, 0)
     self.assertEqual("Deprecated in Twisted 8.0.0.",
                      _getDeprecationDocstring(version))
Exemplo n.º 3
0
    def test_deprecatedUpdatesDocstring(self):
        """
        The docstring of the deprecated function is appended with information
        about the deprecation.
        """

        version = Version('Twisted', 8, 0, 0)
        dummy = deprecated(version)(dummyCallable)

        _appendToDocstring(dummyCallable, _getDeprecationDocstring(version))

        self.assertEqual(dummyCallable.__doc__, dummy.__doc__)
Exemplo n.º 4
0
    def test_deprecatedUpdatesDocstring(self):
        """
        The docstring of the deprecated function is appended with information
        about the deprecation.
        """

        version = Version('Twisted', 8, 0, 0)
        dummy = deprecated(version)(dummyCallable)

        _appendToDocstring(
            dummyCallable,
            _getDeprecationDocstring(version))

        self.assertEqual(dummyCallable.__doc__, dummy.__doc__)