Beispiel #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))
Beispiel #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, ''))
Beispiel #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__)
Beispiel #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__)
Beispiel #5
0
    def test_deprecatedUpdatesDocstring(self):
        """
        The docstring of the deprecated function is appended with information
        about the deprecation.
        """
        def localDummyCallable():
            """
            Do nothing.

            This is used to test the deprecation decorators.
            """

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

        _appendToDocstring(localDummyCallable,
                           _getDeprecationDocstring(version, ''))

        self.assertEqual(localDummyCallable.__doc__, dummy.__doc__)
    def test_deprecatedUpdatesDocstring(self):
        """
        The docstring of the deprecated function is appended with information
        about the deprecation.
        """

        def localDummyCallable():
            """
            Do nothing.

            This is used to test the deprecation decorators.
            """

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

        _appendToDocstring(
            localDummyCallable,
            _getDeprecationDocstring(version, ''))

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