Example #1
0
 def test_getVersionStringWithPrerelease(self):
     """
     L{getVersionString} includes the prerelease, if any.
     """
     self.assertEqual(
         getVersionString(Version("whatever", 8, 0, 0, prerelease=1)),
         "whatever 8.0.0pre1")
Example #2
0
 def test_getVersionString(self):
     """
     L{getVersionString} returns a string with the package name and the
     short version number.
     """
     self.assertEqual('Twisted 8.0.0',
                      getVersionString(Version('Twisted', 8, 0, 0)))
Example #3
0
 def test_getVersionStringWithPrerelease(self):
     """
     L{getVersionString} includes the prerelease, if any.
     """
     self.assertEqual(
         getVersionString(Version("whatever", 8, 0, 0, prerelease=1)),
         "whatever 8.0.0pre1")
Example #4
0
 def test_getVersionString(self):
     """
     L{getVersionString} returns a string with the package name and the
     short version number.
     """
     self.assertEqual(
         'Twisted 8.0.0', getVersionString(Version('Twisted', 8, 0, 0)))
Example #5
0
def _getDeprecationWarningString(fqpn, version, format=None):
    """
    Return a string indicating that the Python name was deprecated in the given
    version.

    @type fqpn: C{str}
    @param fqpn: Fully qualified Python name of the thing being deprecated

    @type version: L{twisted.python.versions.Version}
    @param version: Version that C{fqpn} was deprecated in

    @type format: C{str}
    @param format: A user-provided format to interpolate warning values into,
        or L{DEPRECATION_WARNING_FORMAT} if C{None} is given

    @rtype: C{str}
    @return: A textual description of the deprecation
    """
    if format is None:
        format = DEPRECATION_WARNING_FORMAT
    return format % {'fqpn': fqpn, 'version': getVersionString(version)}
Example #6
0
def _getDeprecationWarningString(fqpn, version, format=None):
    """
    Return a string indicating that the Python name was deprecated in the given
    version.

    @type fqpn: C{str}
    @param fqpn: Fully qualified Python name of the thing being deprecated

    @type version: L{twisted.python.versions.Version}
    @param version: Version that C{fqpn} was deprecated in

    @type format: C{str}
    @param format: A user-provided format to interpolate warning values into,
        or L{DEPRECATION_WARNING_FORMAT} if C{None} is given

    @rtype: C{str}
    @return: A textual description of the deprecation
    """
    if format is None:
        format = DEPRECATION_WARNING_FORMAT
    return format % {
        'fqpn': fqpn,
        'version': getVersionString(version)}
Example #7
0
def _getDeprecationDocstring(version):
    return "Deprecated in %s." % getVersionString(version)
Example #8
0
def _getDeprecationDocstring(version):
    return "Deprecated in %s." % getVersionString(version)