Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_baseWithPrerelease(self):
"""
The base version includes 'preX' for versions with prereleases.
"""
self.assertEqual(Version("foo", 1, 0, 0, prerelease=8).base(),
"1.0.0pre8")
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")
def test_versionComparison(self):
"""
Versions can be compared for equality and order.
"""
va = Version("dummy", 1, 0, 0)
vb = Version("dummy", 0, 1, 0)
self.assertTrue(va > vb)
self.assertTrue(vb < va)
self.assertTrue(va >= vb)
self.assertTrue(vb <= va)
self.assertTrue(va != vb)
self.assertTrue(vb == Version("dummy", 0, 1, 0))
self.assertTrue(vb == vb)
def test_getVersionStringWithRevision(self):
"""
L{getVersionString} includes the discovered revision number.
"""
self.svnEntries.child(b"format").setContent(b"9\n")
self.svnEntries.child(b"entries").setContent(VERSION_10_ENTRIES)
version = getVersionString(self.getVersion())
self.assertEqual(
"twisted_python_versions_package 1.0.0+r22715",
version)
self.assertTrue(isinstance(version, type("")))
def test_infComparison(self):
"""
L{_inf} is equal to L{_inf}.
This is a regression test.
"""
self.assertEqual(_inf, _inf)
def test_disallowBuggyComparisons(self):
"""
The package names of the Version objects need to be the same,
"""
self.assertRaises(IncomparableVersions,
operator.eq,
Version("dummy", 1, 0, 0),
Version("dumym", 1, 0, 0))
"""
Provides klein version information.
"""
# This file is auto-generated! Do not edit!
# Use `python -m incremental.update klein` to change this file.
from incremental import Version
__version__ = Version("klein", 19, 6, 0)
__all__ = ["__version__"]
return self is not other
return NotImplemented
def __hash__(self):
"""
A C{Request} is hashable so that it can be used as a mapping key.
@return A C{int} based on the instance's identity.
"""
return id(self)
Request.getClientIP = deprecated(
Version("Twisted", "NEXT", 0, 0),
replacement="getClientAddress",
)(Request.getClientIP)
Request.noLongerQueued = deprecated(
Version("Twisted", 16, 3, 0))(Request.noLongerQueued)
class _DataLoss(Exception):
"""
L{_DataLoss} indicates that not all of a message body was received. This
is only one of several possible exceptions which may indicate that data
was lost. Because of this, it should not be checked for by
specifically; any unexpected exception should be treated as having
caused data loss.
"""
Twisted Web: HTTP clients and servers, plus tools for implementing them.
Contains a L{web server} (including an
L{HTTP implementation}, a
L{resource model}), and
a L{web client}.
"""
from incremental import Version
from twisted.python.deprecate import deprecatedModuleAttribute
from twisted._version import __version__ as version
__version__ = version.short()
deprecatedModuleAttribute(
Version("Twisted", 16, 0, 0),
"Use twisted.__version__ instead.",
"twisted.web", "__version__")
"""
A C{Request} is hashable so that it can be used as a mapping key.
@return A C{int} based on the instance's identity.
"""
return id(self)
Request.getClientIP = deprecated(
Version("Twisted", "NEXT", 0, 0),
replacement="getClientAddress",
)(Request.getClientIP)
Request.noLongerQueued = deprecated(
Version("Twisted", 16, 3, 0))(Request.noLongerQueued)
class _DataLoss(Exception):
"""
L{_DataLoss} indicates that not all of a message body was received. This
is only one of several possible exceptions which may indicate that data
was lost. Because of this, it should not be checked for by
specifically; any unexpected exception should be treated as having
caused data loss.
"""
class PotentialDataLoss(Exception):
"""
L{PotentialDataLoss} may be raised by a transfer encoding decoder's