Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/twisted/python/test/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyc


=Nc@sddlZddlmZddlmZmZddlmZmZddlm	Z	ddl
mZdZdZ
d	Zd
ZdejfdYZd
ejfdYZdS(iN(tStringIO(tgetVersionStringtIncomparableVersions(tVersiont_inf(tFilePath(tunittests<?xml version="1.0" encoding="utf-8"?>
<wc-entries
   xmlns="svn:">
<entry
   committed-rev="18210"
   name=""
   committed-date="2006-09-21T04:43:09.542953Z"
   url="svn+ssh://svn.twistedmatrix.com/svn/Twisted/trunk/twisted"
   last-author="exarkun"
   kind="dir"
   uuid="bbbe8e31-12d6-0310-92fd-ac37d47ddeeb"
   repos="svn+ssh://svn.twistedmatrix.com/svn/Twisted"
   revision="18211"/>
</wc-entries>
s?8

dir
22715
svn+ssh://svn.twistedmatrix.com/svn/Twisted/trunk
s?9

dir
22715
svn+ssh://svn.twistedmatrix.com/svn/Twisted/trunk
s@10

dir
22715
svn+ssh://svn.twistedmatrix.com/svn/Twisted/trunk
tVersionsTestcBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZRS(cCsVtdddd}tdddd}|j||k|j||k|j||k|j||k|j||k|j|tddddk|j||k|j||k|j||k|j||k|j||k|j||k|j|tddddk|j||kdS(sB
        Versions can be compared for equality and order.
        tdummyiiN(Rt
failUnlesstfailIf(tselftvatvb((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_versionComparison?s ""cCsjtdddddd}tdddd}|j||k|j||k|j||dS(sP
        Prereleases are always less than versions without prereleases.
        twhateveriit
prereleaseN(Rt
assertTruetassertFalsetassertNotEquals(RRR
((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyt%test_comparingPrereleasesWithReleasesWs
cCsptdddddd}tdddddd}|j||k|j||k|j||dS(sW
        The value specified as the prerelease is used in version comparisons.
        RiiRiN(RRRtassertNotEqual(RRR
((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_comparingPrereleasesbs
cCs|jttdS(sR
        L{_inf} is equal to L{_inf}.

        This is a regression test.
        N(tassertEqualR(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_infComparisonmsc	Cs8|jtttddddtdddddS(NRiitdumym(tassertRaisesRtcmpR(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttestDontAllowBuggyComparisonsvs	cCs)|jttddddddS(su
        Calling C{repr} on a version returns a human-readable string
        representation of the version.
        RiiisVersion('dummy', 1, 2, 3)N(RtreprR(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyt	test_repr}sc	Cs/|jttddddddddS(	s
        Calling C{repr} on a version with a prerelease returns a human-readable
        string representation of the version including the prerelease.
        RiiiRis'Version('dummy', 1, 2, 3, prerelease=4)N(RRR(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_reprWithPrereleases$cCs)|jttddddddS(st
        Calling C{str} on a version returns a human-readable string
        representation of the version.
        Riiis[dummy, version 1.2.3]N(RtstrR(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_strsc	Cs/|jttddddddddS(sX
        Calling C{str} on a version with a prerelease includes the prerelease.
        RiiRs[dummy, version 1.0.0pre1]N(RR R(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_strWithPrereleases$cCs)|jtddddjddS(NRiiis1.2.3(RRtshort(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyt	testShortscCs8tdddd}|j|jttddS(sO
        Version should be able to parse an SVN format 4 entries file.
        Riit18211N(RRt_parseSVNEntries_4RtVERSION_4_ENTRIES(Rtversion((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_goodSVNEntries_4scCs8tdddd}|j|jttddS(sO
        Version should be able to parse an SVN format 8 entries file.
        Riit22715N(RRt_parseSVNEntries_8RtVERSION_8_ENTRIES(RR(((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_goodSVNEntries_8scCs8tdddd}|j|jttddS(sO
        Version should be able to parse an SVN format 9 entries file.
        RiiR*N(RRt_parseSVNEntries_9RtVERSION_9_ENTRIES(RR(((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_goodSVNEntries_9scCs8tdddd}|j|jttddS(sP
        Version should be able to parse an SVN format 10 entries file.
        RiiR*N(RRt_parseSVNEntriesTenPlusRtVERSION_10_ENTRIES(RR(((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_goodSVNEntriesTenPlusscCs)|jdttdddddS(sr
        L{getVersionString} returns a string with the package name and the
        short version number.
        s
Twisted 8.0.0tTwistediiN(RRR(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_getVersionStringsc	Cs/|jttddddddddS(sF
        L{getVersionString} includes the prerelease, if any.
        RiiRiswhatever 8.0.0pre1N(RRR(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyt#test_getVersionStringWithPrereleasescCs)|jtddddjddS(sY
        The L{base} method returns a very simple representation of the version.
        tfooiis1.0.0N(RRtbase(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyt	test_basescCs/|jtddddddjddS(sQ
        The base version includes 'preX' for versions with prereleases.
        R7iiRis	1.0.0pre8N(RRR8(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_baseWithPrereleases$(t__name__t
__module__RRRRRRRR!R"R$R)R-R0R3R5R6R9R:(((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyR=s$																											tFormatDiscoveryTestscBs_eZdZdZdZdZdZdZdZdZ	dZ
d	ZRS(
sT
    Tests which discover the parsing method based on the imported module name.
    cCst|j|_tjj|_tjj|jj|jj	d}|j
|j	djd|j	d|_|jj
dS(sN
        Create a temporary directory with a package structure in it.
        ttwisted_python_versions_packages__init__.pysjfrom twisted.python.versions import Version
version = Version('twisted_python_versions_package', 1, 0, 0)
s.svnN(
RtmktemptentrytsystmodulestcopytpreTestModulestpathtappendtchildtmakedirst
setContentt
svnEntries(Rtpkg((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pytsetUps
cCs:tjjtjj|jtjj|jjdS(sI
        Remove the imported modules and sys.path modifications.
        N(RARBtcleartupdateRDREtremoveR@(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttearDowns
cCsV|jjdj|d|jjdj||j|jj|dS(s
        Check for the given revision being detected after setting the SVN
        entries text and format version of the test directory structure.
        tformats
tentriesN(RJRGRIRt
getVersiont_getSVNVersion(Rt
formatVersiontentriesTexttexpectedRevision((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pytcheckSVNFormatscCsddl}|jS(sf
        Import and retrieve the Version object from our dynamically created
        package.
        iN(R>R((RR>((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyRSscCs|jdtddS(sY
        Verify that version 4 format file will be properly detected and parsed.
        t4R%N(RXR'(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_detectVersion4scCs|jdtddS(sb
        Verify that version 8 format files will be properly detected and
        parsed.
        t8R*N(RXR,(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_detectVersion8"scCs|jdtddS(sb
        Verify that version 9 format files will be properly detected and
        parsed.
        t9R*N(RXR/(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_detectVersion9*scCs9|jjdjt|j|jjddS(s
        Verify that version 10 format files will be properly detected and
        parsed.

        Differing from previous formats, the version 10 format lacks a
        I{format} file and B{only} has the version information on the first
        line of the I{entries} file.
        RRR*N(RJRGRIR2RRSRT(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_detectVersion102s	cCs|jddddS(sY
        Verify that a new version of SVN will result in the revision 'Unknown'.
        ssome-random-new-versionsooga booga!tUnknownN(RX(R((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyttest_detectUnknownVersion?s(R;R<t__doc__RLRPRXRSRZR\R^R_Ra(((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyR=s				
						
(RAt	cStringIORttwisted.python.versionsRRRRttwisted.python.filepathRt
twisted.trialRR'R,R/R2tTestCaseRR=(((sE/usr/lib/python2.7/dist-packages/twisted/python/test/test_versions.pyt<module>s