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_release.pyc


=Nc@sdZddlZddlZddlZddlZddlZddlmZddlZddlm	Z
ddlmZddl
mZddlmZddlmZdd	lmZdd
lmZddlmZddlmZmZdd
lmZmZddlmZddlmZm Z ddlm!Z!ddlm"Z"ddlm#Z#m$Z$m%Z%ddlm&Z&m'Z'ddlm(Z(m)Z)ddlm*Z*m+Z+ddlm,Z,ddlm-Z-m.Z.ddlm/Z/m0Z0ddlm1Z1m2Z2ddlm3Z3ej4dkr(dZ5ne6Z5yddl7m8Z8Wne9k
r[dZ:nXe5Z:yddl;Z<Wne9e=fk
rdZ>n1Xe?e<d d!fd!d"fkrd#Z>ne5Z>ed$oed%oed&re5Z@nd'Z@ed(o
ed)re5ZAnd*ZAd+ZBd,eCfd-YZDd.eeDfd/YZEd0efd1YZFd2efd3YZGd4efd5YZHd6eCfd7YZId8eeIfd9YZJd:efd;YZKd<eeIfd=YZLd>eeIfd?YZMd@efdAYZNdBeeDfdCYZOdDeIeDefdEYZPdFePfdGYZQdHePfdIYZRdJeIeDefdKYZSdS(Ls
Tests for L{twisted.python.release} and L{twisted.python._release}.

All of these tests are skipped on platforms other than Linux, as the release is
only ever performed on Linux.
iN(tStringIO(tminidom(tdate(tTestCase(tset(twhich(trelease(tFilePath(tVersion(t_changeVersionInFiletgetNextVersion(tfindTwistedProjectst
replaceInFile(treplaceProjectVersion(tupdateTwistedVersionInformationtProject(tgenerateVersionFileData(tchangeAllProjectVersions(tVERSION_OFFSETt
DocBuildert
ManBuilder(tNoDocumentsFoundt
filePathDelta(t
CommandFailedtBookBuilder(tDistributionBuildert
APIBuilder(tBuildAPIDocsScript(tbuildAllTarballst
runCommand(tUncleanWorkingDirectorytNotWorkingDirectory(tChangeVersionsScripttBuildTarballsScript(tNewsBuildertposixs*Release toolchain only supported on POSIX.(tloresLore is not present.sPydoctor is not present.tversion_infoiisPydoctor is too old.tlatextdvipstps2pdf13sLaTeX is not available.tsvntsvnadminssvn or svnadmin is not present.cOstt||S(s
    A convenience for generating _version.py data.

    @param args: Arguments to pass to L{Version}.
    @param kwargs: Keyword arguments to pass to L{Version}.
    (RR(targstkwargs((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt
genVersionTstStructureAssertingMixincBs)eZdZdZdZdZRS(s
    A mixin for L{TestCase} subclasses which provides some methods for asserting
    the structure and contents of directories and files on the filesystem.
    cCsxxq|D]i}|j|}t||trP|j|j|||q|j||jdtjqWdS(s#
        Create a set of directories and files given a dict defining their
        structure.

        @param root: The directory in which to create the structure.  It must
            already exist.
        @type root: L{FilePath}

        @param dirDict: The dict defining the structure. Keys should be strings
            naming files, values should be strings describing file contents OR
            dicts describing subdirectories.  All files are written in binary
            mode.  Any string values are assumed to describe text files and
            will have their newlines replaced with the platform-native newline
            convention.  For example::

                {"foofile": "foocontents",
                 "bardir": {"barfile": "bar
contents"}}
        @type dirDict: C{dict}
        s
N(	tchildt
isinstancetdicttcreateDirectorytcreateStructuret
setContenttreplacetostlinesep(tselftroottdirDicttxR/((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyR3ds

cCsg|jD]}|j^q
}x|D]}|j|}t||tr|j|jd|jf|j|||n5|j	j
tjd}|j
||||j|j|q,W|r|jd|j|fndS(s
        Assert that a directory is equivalent to one described by a dict.

        @param root: The filesystem directory to compare.
        @type root: L{FilePath}
        @param dirDict: The dict that should describe the contents of the
            directory. It should be the same structure as the C{dirDict}
            parameter to L{createStructure}.
        @type dirDict: C{dict}
        s%s is not a dir!s
s#There were extra children in %s: %sN(tchildrentbasenameR/R0R1t
assertTruetisdirtpathtassertStructuret
getContentR5R6R7tassertEqualtremovetfail(R8R9R:R;R<R/ta((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRAs%
	cCsytjj|jd}t|j}|jx$|D]}|j|d|jq;W|j|j	d|dS(s
        Assert that a tarfile content is equivalent to one described by a dict.

        @param outputFile: The tar file built by L{DistributionBuilder}.
        @type outputFile: L{FilePath}.
        @param dirDict: The dict that should describe the contents of the
            directory. It should be the same structure as the C{dirDict}
            parameter to L{createStructure}.
        @type dirDict: C{dict}
        sr:bz2R@iN(
ttarfiletTarFiletopenR@RtmktempR2textractRAR<(R8t
outputFileR:ttarFilet	extractedtinfo((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytassertExtractedStructures

(t__name__t
__module__t__doc__R3RARP(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyR._s		tChangeVersionTestcBsDeZdZdZdZdZdZdZdZRS(s5
    Twisted has the ability to change versions.
    cCslt|j}tjj|\}}|j|}|j|j|}|j|j||S(s
        Create a file with the given content relative to a temporary directory.

        @param relativePath: The basename of the file to create.
        @param content: The content that the file will have.
        @return: The filename.
        (	RRJR6R@tsplittpreauthChildtmakedirsR/R4(R8trelativePathtcontentt
baseDirectoryt	directorytfilenametfile((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytmakeFiles
cCs]tj}|jt}td|dd}|jt|d|td|dddS(s
        When calculating the next version to release when a release is
        happening in the same year as the last release, the minor version
        number is incremented.
        ttwistedi	itnowi
N(RttodaytyearRRRCR
(R8R`tmajortversion((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_getNextVersions

cCsatj}|jt}td|ddd}|jt|d|td|dddS(s
        When calculating the next version to release when a release is
        happening in a later year, the minor version number is reset to 0.
        R_ii	iR`N(RRaRbRRRCR
(R8R`RcRd((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt"test_getNextVersionAfterYearChanges

cCsd}t|ddd}|jdd|j}t|ddd}t|||j|j|jd|jd	S(
s
        _changeVersionInFile replaces the old version information in a file
        with the given new version information.
        tfooiiitREADMEsHello and welcome to %s.iiN(RR^tbaseR	R@RCRB(R8tpackageNamet
oldVersionR]t
newVersion((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_changeVersionInFiles	cCs"t|j}|jidd6iidd6d6tddddd6iidd6d6td	dddd6d
6d6}|j||t|tddddid
d6iidd6d6tddddd6iidd6d6td	dddd6d
6d6}|j||dS(s
        L{changeAllProjectVersions} changes all version numbers in _version.py
        and README files for all projects as well as in the the top-level
        README file.
        sHi this is 1.0.0.RhsHi this is 1.0.0ttopfilesR_iis_version.pystwisted.webtwebtlolisHi this is 1.0.2.sHi this is 1.0.2N(RRJR2R-R3RRRA(R8R9t	structuretoutStructure((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_changeAllProjectVersionss2
!!c	Csrt|j}|jd}d}idd6||d6iidd6|d6d6tdd	d
d
d6iidd6|d6d6td
d	d
d
d	d6d6d6}|j||t|tdd	d
ddd}d}idd6||d6iidd6|d6d6tdd	d
dd6iidd6|d6d6td
d	d
dd6d6d6}|j||dS(s
        L{changeAllProjectVersions} changes all version numbers in _version.py
        and README files for all projects as well as in the the top-level
        README file. If the old version was a pre-release, it will change the
        version in NEWS files as well.
        sATwisted Core 1.0.0 (2009-12-25)
===============================

sGTwisted Web 1.0.0pre1 (2009-12-25)
==================================

sHi this is 1.0.0.RhtNEWSsHi this is 1.0.0RnR_iis_version.pysHi this is 1.0.0pre1stwisted.webRoRpis
2010-01-01s?Twisted Web 1.0.2 (2010-01-01)
==============================

sHi this is 1.0.2.sHi this is 1.0.2N(RRJR2R-R3RRRA(R8R9tcoreNewstwebNewsRqRr((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt'test_changeAllProjectVersionsPreReleasesF
$!(	RQRRRSR^ReRfRmRsRw(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRTs		
			%tProjectTestcBsYeZdZdZd	dZdZdZdZdZ	dZ
dZRS(
s=
    There is a first-class representation of a project.
    cCs|jt|t|t|dtjd}t|dtjd}x3t||D]"\}}|j|j|jqbWdS(sA
        Assert that two lists of L{Project}s are equal.
        tkeyR[N(RCtlentsortedtoperatort
attrgettertzipR[(R8tobservedProjectstexpectedProjectstobservedtexpected((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytassertProjectsEqualUs		cCs|dkr+t|j}|jn|jjd}|}xL|D]D}|j|}|jsx|jn|jdjdqJW|jdj|jdjdj|j	t
|jdj|t|S(s(
        Make a Twisted-style project in the given base directory.

        @param baseDirectory: The directory to create files in
            (as a L{FilePath).
        @param version: The version information for the project.
        @return: L{Project} pointing to the created project.
        t.s__init__.pytRnRhs_version.pyN(
tNoneRRJR2tpackageRUR/texistsR4RiR
R@R(R8RdRZtsegmentsR[tsegment((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytmakeProjectbs	


%cGsAt|j}|jx|D]}|j||q#W|S(s
        Create a series of projects underneath a temporary base directory.

        @return: A L{FilePath} for the base directory.
        (RRJR2R(R8tversionsRZRd((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytmakeProjects|s


cCs>tdddd}|j|}|j|j|dS(s5
        Project objects know their version.
        RgiiiN(RRRCt
getVersion(R8Rdtproject((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_getVersionscCs|jtdddd}tdddd}|j||j|j||j|jjdjdjd	d
S(sc
        Project objects know how to update the version numbers in those
        projects.
        tbariiiii	RnRhs3.2.9N(RRt
updateVersionRCRR[R/RB(R8RRl((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_updateVersions
cCs3ttd}|jt|d|jdS(sH
        The representation of a Project is Project(directory).
        RsProject(%r)N(RRRCtreprR[(R8Rg((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt	test_reprscCs}|jtddddtdddd}t|}|j|t|jdt|jdjdgd	S(
s
        findTwistedStyleProjects finds all projects underneath a particular
        directory. A 'project' is defined by the existence of a 'topfiles'
        directory and is returned as a Project object.
        Rgiiisfoo.bariiRN(RRRRRR/(R8RZtprojects((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_findTwistedStyleProjectss*cCst|j}|jtj}d}t|ddd}t|d|}|j||}t|d||j	|j
||j	|jjdjdj
|jdS(	sq
        Update Twisted version information in the top-level project and all of
        the subprojects.
        RgiiiR`RnRhN(RRJR2RRaRR
RRRCRR[R/RBRi(R8RZR`tprojectNameRkRlR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt$test_updateTwistedVersionInformations
N(RQRRRSRRRRRRRRR(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRxPs	
	
						tUtilityTestcBs eZdZdZdZRS(s<
    Tests for various utility functions for releasing.
    cCsEtj}d}|jttj||j|tjdS(s
        Test that the runChdirSafe is actually safe, i.e., it still
        changes back to the original directory even if an error is
        raised.
        cSs&tjdtjddddS(Nt	releaseChii(R6tmkdirtchdir(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt
chAndBreaks

N(R6tgetcwdtassertRaisestZeroDivisionErrorRtrunChdirSafeRC(R8tcwdR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt
test_chdirs
		
cCsd}tdd}|j||j|jdd}tdidd6|jtdj||jdd}tdidd6|jtdj|dS(s
        L{replaceInFile} replaces data in a file based on a dict. A key from
        the dict that is found in the file is replaced with the corresponding
        value.
        sfoo
hey hey $VER
bar
srelease.replacetws$VERs2.0.0s3.0.0N(RItwritetcloseR5RRCtread(R8tin_toutfR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_replaceInFiles

(RQRRRSRR(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRs	tVersionWritingTestcBs eZdZdZdZRS(s-
    Tests for L{replaceProjectVersion}.
    cCsTtdtddddidd6}td||j|djdd	S(
s
        L{replaceProjectVersion} writes a Python file that defines a
        C{version} variable that corresponds to the given name and version
        number.
        ttest_projectstwisted.test_projectiiRit	__name___Rds0.82.7N(R
RtexecfileRCRi(R8tns((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_replaceProjectVersions


c	CsZtdtddddddidd6}td||j|d	jd
dS(s
        L{replaceProjectVersion} will write a Version instantiation that
        includes a prerelease parameter if necessary.
        Rstwisted.test_projectiiRit
prereleaseiRRds
0.82.7pre8N(R
RRRCRi(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt(test_replaceProjectVersionWithPrereleases


(RQRRRSRR(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRs	
tBuilderTestsMixincBskeZdZdZdZdZdddZdZdddZd	Z	d
Z
ddZRS(sx
    A mixin class which provides various methods for creating sample Lore input
    and output.

    @cvar template: The lore template that will be used to prepare sample
    output.
    @type template: C{str}

    @ivar docCounter: A counter which is incremented every time input is
        generated and which is included in the documents.
    @type docCounter: C{int}
    s
    <html>
    <head><title>Yo:</title></head>
    <body>
    <div class="body" />
    <a href="index.html">Index</a>
    <span class="version">Version: </span>
    </body>
    </html>
    cCs
d|_dS(sP
        Initialize the doc counter which ensures documents are unique.
        iN(t
docCounter(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytsetUp4scCs2|jtj|jtj|jdS(sJ
        Verify that two strings represent the same XML document.
        N(RCtdomtparseStringttoxml(R8tfirsttsecond((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytassertXMLEqual;sRs%scCs@d}tj|i|d6|d6|d6|dd6jdS(	sJ
        Get the correct HTML output for the arbitrary input returned by
        L{getArbitraryLoreInput} for the given parameters.

        @param version: The version string to include in the output.
        @type version: C{str}
        @param counter: A counter to include in the output.
        @type counter: C{int}
        sO<?xml version="1.0"?><html>
    <head><title>Yo:Hi! Title: %(count)d</title></head>
    <body>
    <div class="content">Hi! %(count)d<div class="API"><a href="%(foobarLink)s" title="foobar">foobar</a></div></div>
    <a href="%(prefix)sindex.html">Index</a>
    <span class="version">Version: %(version)s</span>
    </body>
    </html>tcounttprefixRdtfoobart
foobarLinksutf-8(R(RRR(R8RdtcounterRt
apiBaseURLtdocument((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytgetArbitraryOutputDs
cCsd}|i|d6S(s
        Get an arbitrary, unique (for this test case) string of lore input.

        @param counter: A counter to include in the input.
        @type counter: C{int}
        st<html><head><title>Hi! Title: %(count)s</title></head><body>Hi! %(count)s<div class="API">foobar</div></body></html>R((R8Rttemplate((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytgetArbitraryLoreInput^scCs@|jd7_|j|j|j||jd|d|fS(s
        Get an input document along with expected output for lore run on that
        output document, assuming an appropriately-specified C{self.template}.

        @param version: A version string to include in the input and output.
        @type version: C{str}
        @param prefix: The prefix to include in the link to the index.
        @type prefix: C{str}

        @return: A two-tuple of input and expected output.
        @rtype: C{(str, str)}.
        iRR(RRR(R8RdRR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytgetArbitraryLoreInputAndOutputpscCsdS(s4
        Get an arbitrary man page content.
        s+.TH MANHOLE "1" "August 2001" "" ""
.SH NAME
manhole \- Connect to a Twisted Manhole service
.SH SYNOPSIS
.B manhole
.SH DESCRIPTION
manhole is a GTK interface to Twisted Manhole services. You can execute python
code as if at an interactive Python console inside a running Twisted process
with this.((R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytgetArbitraryManInputscCsdS(s
        Get an arbitrary lore input document which represents man-to-lore
        output based on the man page returned from L{getArbitraryManInput}
        s.<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<title>MANHOLE.1</title></head>
<body>

<h1>MANHOLE.1</h1>

<h2>NAME</h2>

<p>manhole - Connect to a Twisted Manhole service
</p>

<h2>SYNOPSIS</h2>

<p><strong>manhole</strong> </p>

<h2>DESCRIPTION</h2>

<p>manhole is a GTK interface to Twisted Manhole services. You can execute python
code as if at an interactive Python console inside a running Twisted process
with this.</p>

</body>
</html>
((R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytgetArbitraryManLoreOutputs cCs(tjdi|d6|d6jdS(s}
        Get an arbitrary lore output document which represents the lore HTML
        output based on the input document returned from
        L{getArbitraryManLoreOutput}.

        @param version: A version string to include in the document.
        @type version: C{str}
        @param prefix: The prefix to include in the link to the index.
        @type prefix: C{str}
        sn<?xml version="1.0" ?><html>
    <head><title>Yo:MANHOLE.1</title></head>
    <body>
    <div class="content">

<span/>

<h2>NAME<a name="auto0"/></h2>

<p>manhole - Connect to a Twisted Manhole service
</p>

<h2>SYNOPSIS<a name="auto1"/></h2>

<p><strong>manhole</strong> </p>

<h2>DESCRIPTION<a name="auto2"/></h2>

<p>manhole is a GTK interface to Twisted Manhole services. You can execute python
code as if at an interactive Python console inside a running Twisted process
with this.</p>

</div>
    <a href="%(prefix)sindex.html">Index</a>
    <span class="version">Version: %(version)s</span>
    </body>
    </html>RRdsutf-8(RRR(R8RdR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytgetArbitraryManHTMLOutputs(RQRRRSRRRRRRRRR(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRs
						"tDocBuilderTestCasecBseZdZeZdZdZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZRS(
se
    Tests for L{DocBuilder}.

    Note for future maintainers: The exact byte equality assertions throughout
    this suite may need to be updated due to minor differences in lore. They
    should not be taken to mean that Lore must maintain the same byte format
    forever. Feel free to update the tests when Lore changes, but please be
    careful.
    cCsgtj|t|_t|j|_|jj|jjd|_	|j	j
|jdS(s
        Set up a few instance variables that will be useful.

        @ivar builder: A plain L{DocBuilder}.
        @ivar docCounter: An integer to be used as a counter by the
            C{getArbitrary...} methods.
        @ivar howtoDir: A L{FilePath} representing a directory to be used for
            containing Lore documents.
        @ivar templateFile: A L{FilePath} representing a file with
            C{self.template} as its content.
        stemplate.tplN(RRRtbuilderRRJthowtoDirR2R/ttemplateFileR4R(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRs

cCsd}|j|\}}|j|\}}|jjdj||jjdj||jj||j|j|j|jjd}|jjd}|j|j||j|j|dS(sU
        The L{DocBuilder} runs lore on all .xhtml files within a directory.
        s1.2.3s	one.xhtmls	two.xhtmlsone.htmlstwo.htmlN(	RRR/R4RtbuildRRRB(R8Rdtinput1toutput1tinput2toutput2tout1tout2((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt
test_builds
cCs/|jt|jjd|j|j|jdS(s}
        The C{build} method raises L{NoDocumentsFound} if there are no
        .xhtml files in the given directory.
        s1.2.3N(RRRRRR(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_noDocumentsFoundscCs|jd}|jjd}|j|jdj||jjd|j||j|jd}|jd|j	dS(s
        The L{DocBuilder} generates correct links from documents to
        template-generated links like stylesheets and index backreferences.
        ittutorialschild.xhtmls1.2.3s
child.htmls!<a href="../index.html">Index</a>N(
RRR/R2R4RRRtassertInRB(R8tinputttutoDirtoutFile((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_parentDocumentLinkings
	cCs|jd}|jjd}|jjd}|j|jdj||jjd|||j|jd}|jd|j	dS(	s
        It is necessary to generate documentation in a directory foo/bar where
        stylesheet and indexes are located in foo/baz. Such resources should be
        appropriately linked to.
        it	resourcestdocsschild.xhtmls1.2.3s
child.htmls+<a href="../resources/index.html">Index</a>N(
RRR/R2R4RRRRRB(R8RtresourceDirtdocDirR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt$test_siblingDirectoryDocumentLinking.s
	cCsd}|j|\}}|jjdj||jj||j|j|jd|jjd}|jd|jdS(sh
        The L{DocBuilder} generates correct links from documents to API
        documentation.
        s1.2.3s	one.xhtmlsscheme:apilinks/%s.extsone.htmls><a href="scheme:apilinks/foobar.ext" title="foobar">foobar</a>N(	RRR/R4RRRRRB(R8RdRtoutputtout((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_apiLinking?s
cCs|jd}|jjdj||jjd|j|j|jdt|j|jjdj	|j
|jjdj	dS(s
        L{DocBuilder.build} can be instructed to delete the input files after
        generating the output based on them.
        is	one.xhtmltwhatevertdeleteInputsone.htmlN(RRR/R4RRRtTrueR>RtassertFalse(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_deleteInputPscCs|jd}|jjdj||jjd|j|j|j|j|jjdj|j|jjdjdS(s7
        Input will not be deleted by default.
        is	one.xhtmlRsone.htmlN(	RRR/R4RRRR>R(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_doNotDeleteInput]s
cCs5|jjtdtd}|j|ddS(sr
        If the doc and resource directories are the same, the linkrel should be
        an empty string.
        s/foo/barRN(Rt
getLinkrelRRC(R8tlinkrel((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_getLinkrelToSameDirectoryiscCs5|jjtdtd}|j|ddS(sy
        If the doc directory is a child of the resource directory, the linkrel
        should make use of '..'.
        s/foos/foo/bars../N(RRRRC(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt test_getLinkrelToParentDirectorysscCs5|jjtdtd}|j|ddS(s
        If the doc directory is a sibling of the resource directory, the
        linkrel should make use of '..' and a named segment.
        s
/foo/howtos
/foo/exampless	../howto/N(RRRRC(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_getLinkrelToSibling}scCs5|jjtdtd}|j|ddS(s
        If the doc directory is a sibling of the parent of the resource
        directory, the linkrel should make use of multiple '..'s and a named
        segment.
        s
/foo/howtos/foo/examples/quotess../../howto/N(RRRRC(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_getLinkrelToUncles(RQRRRStloreSkiptskipRRRRRRRRRRRR(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRs								
		
	
	
tAPIBuilderTestCasecBs8eZdZeZdZdZdZdZRS(s"
    Tests for L{APIBuilder}.
    c
Cst}|jtd|d}d}d}d}d}d}t|jj|}|j|jdjd	||ft|j}	|	jt}
|
j	|||||	|	jd
}|j
|jd|	jf|j
d||f|jd
|	jd}|j
|jd|jf|j
||jd|j
d||f|j|j
d||f|j|j
||j|j
|jdj|j|jddS(st
        L{APIBuilder.build} writes an index file which includes the name of the
        project specified.
        tstdouttFoobartquuxsscheme:projects
scheme:sourcestext in docstringsshould also appear in outputs__init__.pys(def foo():
    '%s'
def _bar():
    '%s's
index.htmlsAPI index %r did not exist.s<a href="%s">%s</a>s+Project name/location not in file contents.s	quux.htmls,Package documentation file %r did not exist.s,Docstring not in package documentation file.s<a href="%s/%s">View Source</a>s:<a href="%s/%s/__init__.py#L1" class="functionSourceLink">s
quux.foo.htmlRN(RtpatchtsysRRJR/RWR4RRR>RR@RRBtsiblingRCtgetvalue(
R8RRRjt
projectURLt	sourceURLt	docstringtprivateDocstringt	inputPatht
outputPathRt	indexPathtquuxPath((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRsT	

		
		



c	Cszt}|jtd|d}t|j}|jd}|j|jdjd|f|jdjtddddt|j}t	}|j
|||jd	}|j|jd
|j
f|jd|jd|jd
}|j|jd|j
f|j||jd|jd|j|j|jddS(s
        L{BuildAPIDocsScript.buildAPIDocs} builds the API docs with values
        appropriate for the Twisted project.
        Rstext in docstringR_s__init__.pysdef foo():
    '%s'
s_version.pyiis
index.htmlsAPI index %r did not exist.s/<a href="http://twistedmatrix.com/">Twisted</a>s+Project name/location not in file contents.stwisted.htmls,Package documentation file %r did not exist.s,Docstring not in package documentation file.sc<a href="http://twistedmatrix.com/trac/browser/tags/releases/twisted-1.0.0/twisted">View Source</a>RN(RRRRRJR/RWR4R-RtbuildAPIDocsR>RR@RRBRCR(	R8RRtprojectRoottpackagePathRtscriptRttwistedPath((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_buildWithPolicysD	
				
cCs[t}|jt|jg|jt|jdg|jt|jdddgdS(s
        SystemExit is raised when the incorrect number of command line
        arguments are passed to the API building script.
        RgRtbazN(RRt
SystemExittmain(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt-test_apiBuilderScriptMainRequiresTwoArgumentss	cs]t}gfd|_|jddg|jtdtdfgdS(sk
        The API building script invokes the same code that
        L{test_buildWithPolicy} tests.
        csj||fS(N(tappend(RFtb(tcalls(sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt<lambda>sthellotthereN(RRRRCR(R8R((RsD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_apiBuilderScriptMains
	(	RQRRRStpydoctorSkipRRR	R
R(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRs	<	1	tManBuilderTestCasecBs8eZdZeZdZdZdZdZRS(s"
    Tests for L{ManBuilder}.
    cCs?tj|t|_t|j|_|jjdS(s
        Set up a few instance variables that will be useful.

        @ivar builder: A plain L{ManBuilder}.
        @ivar manDir: A L{FilePath} representing a directory to be used for
            containing man pages.
        N(RRRRRRJtmanDirR2(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyR$s
cCs |jt|jj|jdS(sy
        L{ManBuilder.build} raises L{NoDocumentsFound} if there are no
        .1 files in the given directory.
        N(RRRRR(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyR2scCs|j}|jjdj||jj|j|jjdj}|j}|jdt	j
}|j||dS(s
        Check that L{ManBuilder.build} find the man page in the directory, and
        successfully produce a Lore content.
        stest1.1stest1-man.xhtmls
N(RRR/R4RRRBRR5R6R7RC(R8t
manContentRR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyR:scCs|j}|jjdj||jj|j|jjd}|jtjt}|jd|j|j||jjdj	}|j
|ddS(sr
        Check that the content output by C{build} is compatible as input of
        L{DocBuilder.build}.
        stest1.1stemplate.tpls1.2.3stest1-man.htmls^<?xml version="1.0" ?><html>
    <head><title>Yo:MANHOLE.1</title></head>
    <body>
    <div class="content">

<span/>

<h2>NAME<a name="auto0"/></h2>

<p>manhole - Connect to a Twisted Manhole service
</p>

<h2>SYNOPSIS<a name="auto1"/></h2>

<p><strong>manhole</strong> </p>

<h2>DESCRIPTION<a name="auto2"/></h2>

<p>manhole is a GTK interface to Twisted Manhole services. You can execute python
code as if at an interactive Python console inside a running Twisted process
with this.</p>

</div>
    <a href="index.html">Index</a>
    <span class="version">Version: 1.2.3</span>
    </body>
    </html>N(RRR/R4RRRRRRBR(R8RRt
docBuilderR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_toHTMLIs	(	RQRRRSRRRRRR(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRs			tBookBuilderTestscBseZdZepeZdZdZdddZ	dZ
dZdZdZ
d	Zd
ZdZdZd
ZdZdZdZdZdZdZdZdZdZRS(s#
    Tests for L{BookBuilder}.
    cCsJd|_t|j|_|jjtjtjtj|_dS(sG
        Make a directory into which to place temporary files.
        iN(	RRRJRRWtsignaltSIGCHLDtSIG_DFLt
oldHandler(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRs	
cCstjtj|jdS(N(RRR(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttearDownsRcCs2|jjd|fj}di|d6|d6S(s
        Create and return a C{str} containing the LaTeX document which is
        expected as the output for processing the result of the document
        returned by C{self.getArbitraryLoreInput(counter)}.
        s%d.xhtmlsB\section{Hi! Title: %(count)s\label{%(path)s}}
Hi! %(count)sfoobarRR@(RR/R@(R8RdRRRR@((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRscCs2t}|j|jtjddgddS(s
        L{BookBuilder.run} executes the command it is passed and returns a
        string giving the stdout and stderr of the command if it completes
        successfully.
        s-csgimport sys; sys.stdout.write("hi\n"); sys.stdout.flush(); sys.stderr.write("bye\n"); sys.stderr.flush()shi
bye
N(RRCtrunRt
executable(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_runSuccesss			cCsjt}|jt|jtjddg}|j|jd|j|jd|j|j
ddS(s
        L{BookBuilder.run} executes the command it is passed and raises
        L{CommandFailed} if it completes unsuccessfully.
        s-csprint "hi"; raise SystemExit(1)ishi
N(RRRR!RR"RCt
exitStatust
exitSignalRR(R8Rtexc((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_runFaileds		cCsjt}|jt|jtjddg}|j|jd|j|jd|j|j
ddS(s
        L{BookBuilder.run} executes the command it is passed and raises
        L{CommandFailed} if it exits due to a signal.
        s-csNimport sys; print "hi"; sys.stdout.flush(); import os; os.kill(os.getpid(), 9)i	shi
N(RRRR!RR"RCR%R$RR(R8RR&((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_runSignaleds			cCsd}|j|\}}|j|\}}|jjdj||jjdj|t}|j|j|j|jjdj||j|jjdj|dS(sx
        L{BookBuilder.buildTeX} writes intermediate TeX files for all lore
        input files in a directory.
        s3.2.1s1.xhtmls2.xhtmls1.texs2.texN(RRR/R4RtbuildTeXRCRB(R8RdRRRRR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt
test_buildTeXs	"cCs,t}|jt|j|jjdS(sr
        L{BookBuilder.buildTeX} raises L{ValueError} if passed a directory
        which does not exist.
        N(RRt
ValueErrorR)RttemporarySibling(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt$test_buildTeXRejectsInvalidDirectorys	cCs'|jjdjd|jdS(sd
        L{BookBuilder.buildTeX} ignores files which which don't end with
        ".xhtml".
        s
not-input.datt>N(RR/R4R*(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_buildTeXOnlyBuildsXHTMLscCsVt}|jtd||jtdd|j|j|jddS(sC
        L{BookBuilder.buildTeX} does not write to stdout.
        Rtwarnc_sdS(N(R(RFtkw((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRsRN(RRRtwarningsR*RCR(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_stdouts
	
cCs>t}|jt|jt|jjddddS(su
        L{BookBuilder.buildPDF} raises L{ValueError} if the book filename does
        not end with ".tex".
        RgN(RRR+tbuildPDFRRJR/R(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt'test_buildPDFRejectsInvalidBookFilenames	cCs&td}|j||j|S(Ni(tranget_setupTeXSectionst
_setupTeXBook(R8tsections((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt_setupTeXFiless
cCsGx@|D]8}|jjd|f}|j|jd|qWdS(Ns%d.texs1.2.3(RR/R4R(R8R9ttexSectionNumberttexPath((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyR7s
cCsN|jjd}|jddjg|D]}d|f^q(d|S(Nsbook.texs&\documentclass{book}
\begin{document}
s
s\input{%d.tex}s\end{document}
(RR/R4tjoin(R8R9tbookTeXtn((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyR8s
*cCsT|j}t|j}t}|j||j||j|jdS(s~
        L{BookBuilder.buildPDF} creates a PDF given an index tex file and a
        directory containing .tex files.
        N(R:RRJRR4RR>R(R8tbookPathRR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt
test_buildPDF&s
	cCs|jjddjddjdd|_|jj|j}t|j}t}|j||j||j|j	dS(s
        L{BookBuilder.buildPDF} succeeds even if the paths it is operating on
        are very long.

        C{ps2pdf13} seems to have problems when path names are long.  This test
        verifies that even if inputs have long paths, generation still
        succeeds.
        R;iN(
RR/RWR:RRJRR4R>R(R8R@RR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_buildPDFLongPath4s
3
	c
CsdtfdY}|j}t|j}|}|j||j||j\}}}}}	|j|||j|||j|d dgd|f|j|d|jgd||jf|j|d dgd	|f|j|	d d
gd|	fdS(
sD
        L{BookBuilder.buildPDF} runs C{latex} three times.
        tInspectableBookBuildercBseZdZdZRS(cSstj|g|_dS(N(Rt__init__tcommands(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRDPs
cSs |jj|tj||S(sI
                Record the command and then execute it.
                (RERRR!(R8tcommand((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyR!Ts(RQRRRDR!(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRCOs	iR&s%LaTeX command %r does not seem right.is6LaTeX command %r does not end with the book path (%r).R's%dvips command %r does not seem right.R(s(ps2pdf13 command %r does not seem right.N(	RR:RRJR4RRERCR@(
R8RCR@RRtlatex1tlatex2tlatex3R'R(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt test_buildPDFRunsLaTeXThreeTimesKs*	


cCstj}|j}|jj}|jj}t}|j||jt|j	|j
|tj|j
||jj|j
||jjdS(s
        The working directory is the same before and after a call to
        L{BookBuilder.buildPDF}.  Also the contents of the directory containing
        the input book are the same before and after the call.
        N(R6RR:tparentR<RRR4RRJRC(R8tstartDirR>tstartTeXSiblingststartHowtoChildrenR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_noSideEffectsws	"cCst|jd}t}|jj}|jt|j||jt|j}|j	|j
t|jjt|}|jt
|d|j}|j	|jd|jfdS(s
        If a subprocess fails, L{BookBuilder.buildPDF} raises L{CommandFailed}
        with the subprocess's output and leaves the temporary directory as a
        sibling of the book path.
        s.texis*Expected work path %r was not a directory.N(RRJRRKR<RRR4RR>RRRCRztpopR?R@(R8R>Rt
inputStateR&tnewOutputStatetworkPath((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt test_failedCommandProvidesOutputs	"	cCstdd}x7|D]/}|jjd|fj|j|qW|j|}t|j}t}|j	|j|jg|||j
|jdS(sd
        L{BookBuilder.build} generates a pdf book file from some lore input
        files.
        iis%d.xhtmlN(R6RR/R4RR8RRJRRR>R(R8R9t
sectionNumberR>tbookPDFR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRs
	cCstdd}x7|D]/}|jjd|fj|j|qW|j|}t|j}t}|j	|j|jg|||j
t|jjt|j
gg|D]}d|f^qdS(sW
        L{BookBuilder.build} removes the intermediate LaTeX files it creates.
        iis%d.xhtmlN(R6RR/R4RR8RRJRRRCRtlistdirR=(R8R9RUR>RVRR?((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt$test_buildRemovesTemporaryLaTeXFiless
	N(RQRRRSt	latexSkipRRRR RRR#R'R(R*R-R/R3R5R:R7R8RARBRJRORTRRX(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRzs.	
	
					
	
					
			,			tFilePathDeltaTestcBs2eZdZdZdZdZdZRS(s%
    Tests for L{filePathDelta}.
    cCs,|jttdtddgdS(sU
        L{filePathDelta} can create a simple relative path to a child path.
        s/foo/bars/foo/bar/bazR
N(RCRR(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_filePathDeltaSubdirscCs/|jttdtdddgdS(se
        L{filePathDelta} can traverse upwards to create relative paths to
        siblings.
        s/foo/bars/foo/bazs..R
N(RCRR(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_filePathDeltaSiblingDirscCs5|jttdtdddddgdS(sx
        L{filePathDelta} can create relative paths to totally unrelated paths
        for maximum portability.
        s/foo/bars	/baz/quuxs..R
RN(RCRR(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_filePathNoCommonElementsscCs5|jttdtdddddgdS(s
        L{filePathDelta} doesn't take into account final elements when
        comparing 2 paths, but stops at the first difference.
        s/foo/bar/bar/spams/foo/bar/baz/spams..R
tspamN(RCRR(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt$test_filePathDeltaSimilarEndElementss(RQRRRSR[R\R]R_(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRZs
			
	
tNewsBuilderTestscBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZRS(s#
    Tests for L{NewsBuilder}.
    cCst|_t|j|_|jjd|_|j|ji|jd6dd6dd6dd6d	d
6dd6d
d6dd6dd6dd6dd6dS(sc
        Create a fake project and stuff some basic structure and content into
        it.
        s,Here is stuff which was present previously.
RtsWe now support the web.
s	5.featuresThe widget is more robust.
s
12.featuresA very long feature which takes many words to describe with any accuracy was introduced so that the line wrapping behavior of the news generating code could be verified.
s
15.features9A simpler feature
described on multiple lines
was added.
s
16.featuresBroken stuff was fixed.
s	23.bugfixsStupid stuff was deprecated.
s
25.removalRs30.miscs35.miscsfoo.bar.Baz.quuxs40.docswriting Foo serverss41.docN(R"RRRJRR2texistingTextR3(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRs 
	
cCs,|j|jjtjjddS(sP
        L{NewsBuilder._today} returns today's date in YYYY-MM-DD form.
        s%Y-%m-%dN(RCRt_todayRRatstrftime(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt
test_todayscCs>|jj|j|jj}|j|d
ddd
gd	S(s
        When called with L{NewsBuilder._FEATURE}, L{NewsBuilder._findChanges}
        returns a list of bugfix ticket numbers and descriptions as a list of
        two-tuples.
        isWe now support the web.isThe widget is more robust.isA very long feature which takes many words to describe with any accuracy was introduced so that the line wrapping behavior of the news generating code could be verified.is8A simpler feature described on multiple lines was added.N(isWe now support the web.(isThe widget is more robust.(isA very long feature which takes many words to describe with any accuracy was introduced so that the line wrapping behavior of the news generating code could be verified.(is8A simpler feature described on multiple lines was added.(Rt_findChangesRt_FEATURERC(R8tfeatures((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_findFeaturess	cCs5|jj|j|jj}|j|dgdS(s
        When called with L{NewsBuilder._BUGFIX}, L{NewsBuilder._findChanges}
        returns a list of bugfix ticket numbers and descriptions as a list of
        two-tuples.
        isBroken stuff was fixed.N(isBroken stuff was fixed.(RReRt_BUGFIXRC(R8tbugfixes((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_findBugfixes/s
	cCs5|jj|j|jj}|j|dgdS(s
        When called with L{NewsBuilder._REMOVAL}, L{NewsBuilder._findChanges}
        returns a list of removal/deprecation ticket numbers and descriptions
        as a list of two-tuples.
        isStupid stuff was deprecated.N(isStupid stuff was deprecated.(RReRt_REMOVALRC(R8tremovals((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_findRemovals<s
	cCs8|jj|j|jj}|j|ddgdS(s
        When called with L{NewsBuilder._DOC}, L{NewsBuilder._findChanges}
        returns a list of documentation ticket numbers and descriptions as a
        list of two-tuples.
        i(sfoo.bar.Baz.quuxi)swriting Foo serversN(i(sfoo.bar.Baz.quux(i)swriting Foo servers(RReRt_DOCRC(R8tdoc((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_findDocumentationIs	cCs8|jj|j|jj}|j|ddgdS(s
        When called with L{NewsBuilder._MISC}, L{NewsBuilder._findChanges}
        returns a list of removal/deprecation ticket numbers and descriptions
        as a list of two-tuples.
        iRi#N(iR(i#R(RReRt_MISCRC(R8tmisc((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_findMiscellaneousWs	cCs6t}|jj|d|j|jddS(s
        L{NewsBuilder._writeHeader} accepts a file-like object opened for
        writing and a header string and writes out a news file header to it.
        sSuper Awesometastic 32.16s5Super Awesometastic 32.16
=========================

N(RRt_writeHeaderRCR(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_writeHeaderes
		cCs?t}|jj|ddd	g|j|jddS(
s
        L{NewsBuilder._writeSection} accepts a file-like object opened for
        writing, a section name, and a list of ticket information (as returned
        by L{NewsBuilder._findChanges}) and writes out a section header and all
        of the given ticket information.
        tFeaturesisGreat stuff.ismVery long line which goes on and on and on, seemingly without end until suddenly without warning it does end.sFeatures
--------
 - Great stuff. (#3)
 - Very long line which goes on and on and on, seemingly without end
   until suddenly without warning it does end. (#17)

N(isGreat stuff.(ismVery long line which goes on and on and on, seemingly without end until suddenly without warning it does end.(RRt
_writeSectionRCR(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_writeSectionss		
	cCs^t}|jj|dgtdddD]}|df^q+|j|jddS(s-
        L{NewsBuilder._writeMisc} accepts a file-like object opened for
        writing, a section name, and a list of ticket information (as returned
        by L{NewsBuilder._findChanges} and writes out a section header and all
        of the ticket numbers, but excludes any descriptions.
        tOtherii2iRs_Other
-----
 - #2, #5, #8, #11, #14, #17, #20, #23, #26, #29, #32, #35, #38, #41,
   #44, #47

N(RRt
_writeMiscR6RCR(R8RR;((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_writeMiscs		,	cCsX|jj|j|jjdd|jjdj}|j|d|jdS(s
        L{NewsBuilder.build} updates a NEWS file with new features based on the
        I{<ticket>.feature} files found in the directory specified.
        RtsSuper Awesometastic 32.16sSuper Awesometastic 32.16
=========================

Features
--------
 - We now support the web. (#5)
 - The widget is more robust. (#12)
 - A very long feature which takes many words to describe with any
   accuracy was introduced so that the line wrapping behavior of the
   news generating code could be verified. (#15)
 - A simpler feature described on multiple lines was added. (#16)

Bugfixes
--------
 - Broken stuff was fixed. (#23)

Improved Documentation
----------------------
 - foo.bar.Baz.quux (#40)
 - writing Foo servers (#41)

Deprecations and Removals
-------------------------
 - Stupid stuff was deprecated. (#25)

Other
-----
 - #30, #35


N(RRRR/RBRCRa(R8tresults((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRs	cCst|jjd}|j|j|i|jd6|jj||jdd|jdj}|j	|d|jj
d|jdS(s
        If no changes exist for a project, I{NEWS} gains a new section for
        that project that includes some helpful text about how there were no
        interesting changes.
        R_RtsSuper Awesometastic 32.16s5Super Awesometastic 32.16
=========================

s

N(RRJR/RWR3RaRRRBRCt_NO_CHANGES(R8RR}((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_emptyProjectCalledOuts
	cCsR|jjd}|jd|jj|j|d|j|jddS(s
        If a I{NEWS} file begins with the two magic lines which point readers
        at the issue tracker, those lines are kept at the top of the new file.
        RtsTicket numbers in this file can be looked up by visiting
http://twistedmatrix.com/trac/ticket/<number>

Blah blah other stuff.
sSuper Awesometastic 32.16sTicket numbers in this file can be looked up by visiting
http://twistedmatrix.com/trac/ticket/<number>

Super Awesometastic 32.16
=========================

Features
--------
 - We now support the web. (#5)
 - The widget is more robust. (#12)
 - A very long feature which takes many words to describe with any
   accuracy was introduced so that the line wrapping behavior of the
   news generating code could be verified. (#15)
 - A simpler feature described on multiple lines was added. (#16)

Bugfixes
--------
 - Broken stuff was fixed. (#23)

Improved Documentation
----------------------
 - foo.bar.Baz.quux (#40)
 - writing Foo servers (#41)

Deprecations and Removals
-------------------------
 - Stupid stuff was deprecated. (#25)

Other
-----
 - #30, #35


Blah blah other stuff.
N(RR/R4RRRCRB(R8tnews((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_preserveTicketHints	cCsx:|jjD])}|jdd	kr|jqqW|jj|j|jjdd|j|jjdjddS(
s
        If there are no changes of a particular type (feature, bugfix, etc), no
        section for that type is written by L{NewsBuilder.build}.
        is.features.miscs.docRtsSome Thing 1.2sSome Thing 1.2
==============

Bugfixes
--------
 - Broken stuff was fixed. (#23)

Deprecations and Removals
-------------------------
 - Stupid stuff was deprecated. (#25)


Here is stuff which was present previously.
N(s.features.miscs.doc(	RR<tsplitextRDRRR/RCRB(R8tticket((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_emptySectionsOmitteds	csfd}|dj|d|dj|djjjjjddjjjdjddS(	sr
        If two change files have the same contents, they are merged in the
        generated news entry.
        csjj|dS(Ns.feature(RR/(ts(R8(sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytfeature6st5t15t16RtsProject Name 5.0sProject Name 5.0
================

Features
--------
 - We now support the web. (#5, #15, #16)
 - The widget is more robust. (#12)

Bugfixes
--------
 - Broken stuff was fixed. (#23)

Improved Documentation
----------------------
 - foo.bar.Baz.quux (#40)
 - writing Foo servers (#41)

Deprecations and Removals
-------------------------
 - Stupid stuff was deprecated. (#25)

Other
-----
 - #30, #35


Here is stuff which was present previously.
N(tcopyToRRRR/RCRB(R8R((R8sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_duplicatesMerged1s	c	Cst|jjd}|j|j|idd6tddddd6idd6d	d
6dd6d
6itddddd6idd6dd6d
6d6|S(sF
        Create a fake-looking Twisted project to build from.
        R_s Old boring stuff from the past.
Rtiiis_version.pysOld core news.
sThird feature addition.
s	3.featureRs5.miscRns
twisted.conchiisOld conch news.
sFixed that bug.
s7.bugfixtconch(RRJR/RWR3R-(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytcreateFakeTwistedProject]s
c
sgt}fd|_d|_|j}|j||jd}|jd}d}|jdjd}|jd}d}|jd}	|j|||f|||f||	|f||	|fgdS(	s
        L{NewsBuilder.buildAll} calls L{NewsBuilder.build} once for each
        subproject, passing that subproject's I{topfiles} directory as C{path},
        the I{NEWS} file in that directory as C{output}, and the subproject's
        name as C{header}, and then again for each subproject with the
        top-level I{NEWS} file for C{output}. Blacklisted subprojects are
        skipped.
        csj|||fS(N(R(R@Rtheader(tbuilds(sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyR~scSsdS(Ns
2009-12-01((((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRsRnRtsTwisted Core 1.2.3 (2009-12-01)Rs Twisted Conch 3.4.5 (2009-12-01)N(R"RRbRtbuildAllR/RC(
R8RRtcoreTopfilesRut
coreHeadert
conchTopfilest	conchNewstconchHeadert
aggregateNews((RsD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt
test_buildAllss&		
cCst}d|_|j}|j|tdddd}|jdjd}|j|dtdd	d
d|dd
}|j|d|jdS(s|
        L{NewsBuilder._changeVersions} gets the release date for a given
        version of a project as a string.
        cSsdS(Ns
2009-12-01((((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRstTEMPLATEiiRnRttCoreR_iiis
2010-01-01sTwisted Core 7.7.14 (2010-01-01)
================================

Features
--------
 - Third feature addition. (#3)

Other
-----
 - #5


sOld core news.
N(	R"RbRRRR/t_changeNewsVersionRCRB(R8RRRlRutexpectedCore((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_changeVersionInNewss	


(RQRRRSRRdRhRkRnRqRtRvRyR|RRRRRRRR(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyR`s&				
	
						+		3		,		$tDistributionBuilderTestBasecBseZdZeZdZRS(s3
    Base for tests of L{DistributionBuilder}.
    cCsmtj|t|j|_|jjt|j|_|jjt|j|j|_dS(N(	RRRRJtrootDirR2t	outputDirRR(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRs


(RQRRRSRRR(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRstDistributionBuilderTestcBs>eZdZdZdZdZdZdZRS(cCsw|jd\}}|j}|jdd}|j}|jdd}|jddd\}}idd6dd6d	d
6dd6iid
d6d6dd6d6iidd6idd6dd6d6d6idd6d6idd6dd6d6d6iii|d 6d!6i|d"6d#6d6ii|jd$6d!6i|d%6d#6|d 6d&6d'6}	idd6dd6d	d
6dd6iid
d6d6dd6d6iidd6idd6dd6d6d6idd6d6idd6dd6d6d6iii|d(6d!6i|d"6|d)6d#6d6ii|jd$6d!6i|d%6|d*6d#6|d(6d&6d'6}
|j|j|	|jjd}|j||
d+S(,ss
        The Twisted tarball contains everything in the source checkout, with
        built documentation.
        s10.0.0s	../howto/Rshowto/tTwistedRhR;t	unrelateds
copyright!tLICENSEsimport toplevelssetup.pysSET ROOTt
websetrootRotTWISTDttwistdtbins
import WEBs__init__.pysimport WEBINSTALLsWEB!Rnsimport WORDStwordssimport WEBPLUGstwisted_web.pysimport WORDPLUGstwisted_words.pytpluginsR_sindex.xhtmlthowtoswebsetroot.1tmanstemplate.tplstwistd.1tcoreRps
index.htmlswebsetroot-man.htmlstwistd-man.htmlN(	RRRRR3RRtbuildTwistedRP(R8t	loreInputt
loreOutputt	manInput1t
manOutput1t	manInput2t
manOutput2tcoreIndexInputtcoreIndexOutputRqRrRL((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_twistedDistributionsb







cCsidd6dd6dd6dd6iid	d
6d6idd
6d6d6iidd6idd6dd6d6d6idd6d6idd6dd6d6d6}idd6dd6dd6id	d
6d6iidd6d6idd6d6d6}|j|j||jjdd}|j||dS(s
        The subproject tarball includes files like so:

        1. twisted/<subproject>/topfiles defines the files that will be in the
           top level in the tarball, except LICENSE, which comes from the real
           top-level directory.
        2. twisted/<subproject> is included, but without the topfiles entry
           in that directory. No other twisted subpackages are included.
        3. twisted/plugins/twisted_<subproject>.py is included, but nothing
           else in plugins is.
        sHI!@RhR;Rs
copyright!Rsimport toplevelssetup.pysSET ROOTRRos#!imtimRRs
import WEBs__init__.pysimport WEBINSTALLsWEB!Rnsimport WORDSsimport WEBPLUGstwisted_web.pysimport WORDPLUGstwisted_words.pyRR_s0.3.0N(R3RRtbuildSubProjectRP(R8RqRrRL((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_subProjectLayout
s0


cCsidd6id6iidd6idd6d6d	6id
6d6}idd6dd6iidd6d	6d6}|j|j||jjd	d}|j||d
S(sG
        buildSubProject should work with minimal subprojects.
        s
copyright!RRs
import WEBs__init__.pysimport WEBINSTALLssetup.pyRnRoRR_s0.3.0N(R3RRRRP(R8RqRrRL((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_minimalSubProjectLayout5s
cCs4|jd\}}|j}|jdd}idd6iidd6idd6d	6d
6d6iii|d6d
6i|d6d6d
6ii|jd6d
6d6d6}idd6dd6iidd6d
6d6ii|d6d
6i|d6|d6d6d6}|j|j||jjd
d}|j||dS(sf
        When building a subproject release, documentation should be built with
        lore.
        s0.3.0s	../howto/s
copyright!Rs
import WEBs__init__.pysimport WEBINSTssetup.pyRnRoR_sindex.xhtmlRstwistd.1Rstemplate.tplRRps
index.htmlstwistd-man.htmlN(	RRRRR3RRRRP(R8RRtmanInputt	manOutputRqRrRL((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_subProjectDocBuildingMs(

cCs|jddd\}}|jd\}}|jddd\}}|jddd\}}|jddd\}	}
idd6idd	6id
d	6dd6d
6id
d	6dd6d
6dd6idd6dd6dd6d6idd6dd6d6d6iii|jd6|d6i|	d6d6d 6i|d6d!6i|d6d"6id#d#6d$6|d6d%6iid&d6d 6d'6d(6id)d*6id+d+6d'6d,6}idd6dd6dd6idd	6id
d	6dd6d
6dd6idd6dd6d6d6ii|jd6|d-6i|
d-6d6d 6i|d-6d!6i|d-6d"6id#d#6d$6|d-6d(6id)d*6d,6}|j|j||jjd}
|j|
|d.S(/s
        The core tarball looks a lot like a subproject tarball, except it
        doesn't include:

        - Python packages from other subprojects
        - plugins from other subprojects
        - scripts from other subprojects
        s8.0.0Rshowto/s	../howto/s../s
copyright!RR_s__init__.pytpythonsroots!sroots.pyRsimport conchsunrelated.pytplugins	plugin.pytwebplugstwisted_web.pysinclude!stwisted_whatever.pyscred.pyRsimport COREssetup.pyscore readmeRhRnstemplate.tplsindex.xhtmlRRtspecificationstupgradessfoo.pytexamplesRtwebindexRoRpRRRRs
index.htmlN(RRR3RRt	buildCoreRP(R8t
indexInputtindexOutputt
howtoInputthowtoOutputt	specInputt
specOutputtupgradeInputt
upgradeOutputt
tutorialInputttutorialOutputRqRrRL((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_coreProjectLayoutnsj	








cCsd}t|j|jd|}|jdd|\}}idd6iidd6idd	6d
6d6d6iii|d
6d6d6ii|jd6d6d6d6}idd6dd	6iidd6d6d6ii|d6d6d6}|j|j||jdd}|j||dS(sc
        DistributionBuilder builds documentation with the specified
        API base URL.
        s	http://%sRs0.3.0s
copyright!Rs
import WEBs__init__.pysimport WEBINSTssetup.pyRnRoR_sindex.xhtmlRstemplate.tplRRps
index.htmlN(RRRRRR3RRP(R8RRRRRqRrRL((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_apiBaseURLs&	
(RQRRRRRRRR(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRs	?	+		!	FtBuildAllTarballsTestcBsAeZdZeZdZdZdZdZdZ	RS(s<
    Tests for L{DistributionBuilder.buildAllTarballs}.
    cCs,tjtjtj|_tj|dS(N(RRRRRR(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRscCs'tjtj|jtj|dS(N(RRRRR (R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyR sc
CsX|j}t|}|j}t|}|jjtdd|gtddd|j|jg|jdddd	d
\}}idd6d
d6dd6dd6iidd6d6dd6d6iidd6dd6d6tddddd 6id!d"6td#dddd 6id$d6d%d6d6d6id&d'6d(d)6d*d+6d,6d6iii|jd-6d.6|d/6d06d16}idd6d
d6dd6dd6idd6idd6d6d6iidd6dd6d6tddddd 6id!d"6td#dddd 6id$d6d%d6d6d6id&d'6d(d)6d*d+6d,6d6iii|jd-6d.6|d26d06d16}idd6dd6dd6idd6d6itddddd 6id*d+6d,6d6ii|jd-6d.6|d26d16}	id%d6dd6d$d6idd6d6iid!d"6td#dddd 6d6id(d)6d,6d6}
|j	||g|j
D]}|j^qY}tdd3g|tdd4|jd5d6gt||j|jt
|jj
t
|jjd7|jjd8|jjd9g|j|jjd7||j|jjd8|	|j|jjd9|
d:S(;s0
        L{buildAllTarballs} builds tarballs for Twisted and all of its
        subprojects based on an SVN checkout; the resulting tarballs contain
        no SVN metadata.  This involves building documentation, which it will
        build with the correct API documentation reference base URL.
        R*tcreateR)tcheckoutsfile://s1.2.0Rshowto/Rs4http://twistedmatrix.com/documents/1.2.0/api/%s.htmlRRhR;Rs
copyright!Rsimport toplevelssetup.pys	import imRRRRRsimport TOPINSTALLsCORE!RnR_iiis_version.pysimport WORDSs__init__.pys
twisted.wordssimport WORDSINSTALLsWORDS!simport WEBPLUGstwisted_web.pysimport WORDPLUGstwisted_words.pys
import YAYstwisted_yay.pyRstemplate.tplRsindex.xhtmlRRps
index.htmltaddtcommits-mtyaysTwisted-1.2.0.tar.bz2sTwistedCore-1.2.0.tar.bz2sTwistedWords-1.2.0.tar.bz2N(RJRRRDRR@RR-RR3R<RRCRR/RP(
R8trepositoryPatht
repositorytcheckoutPathRRRRqttwistedStructuret
coreStructuretwordsStructureR;tchilds((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_buildAllTarballss











"cCs|j}t|}|j}t|}tdd|gtddd|j|jg|jdjd|jtt|t|jdS(	s
        L{UncleanWorkingDirectory} is raised by L{buildAllTarballs} when the
        SVN checkout provided has uncommitted changes.
        R*RR)Rsfile://RgRN(	RJRRR@R/R4RRR(R8RRRR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt)test_buildAllTarballsEnsuresCleanCheckoutV	s
	cCsdt|j}|jtt|t|j|j|jtt|t|jdS(s
        L{NotWorkingDirectory} is raised by L{buildAllTarballs} when the
        checkout passed does not exist or is not an SVN checkout.
        N(RRJRRRR2(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt,test_buildAllTarballsEnsuresExistingCheckouti	s	
	(
RQRRRStsvnSkipRRR RRR(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRs			s	tScriptTestscBs}eZdZd
dZdZdZdZdZdZ	dZ
dZd	Zd
Z
dZdZRS(s5
    Tests for the release script functionality.
    csgfd}t}||_d|||f}|dk	rZ|d|f7}n|j|g|jtd|jddtd|jddj||jddj||jddj	||jddj
|dS(s
        Check that L{ChangeVersionsScript.main} calls the version-changing
        function with the appropriate version data and filesystem path.
        csj||fdS(N(R(t
sourceTreetversionTemplate(tversionUpdates(sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pytmyVersionChanger	ss%d.%d.%dspre%diiRN(R RRRRCRzRRctminortmicroR(R8RcRRRRtversionChangerRd((RsD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt_testVersionChanging~	s		cCs|jddddS(sh
        L{ChangeVersionsScript.main} changes version numbers for all Twisted
        projects.
        iiiN(R(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_changeVersions	scCs|jdddddS(sK
        A prerelease can be specified to L{changeVersionsScript}.
        i	iii&N(R(R8((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt!test_changeVersionsWithPrerelease	scCs t}|j|jtdS(ss
        The default implementation of C{changeAllProjectVersions} is
        L{changeAllProjectVersions}.
        N(R RCR(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt(test_defaultChangeVersionsVersionChanger	s	cCs#t}|jt|jgdS(sr
        L{changeVersionsScript} raises SystemExit when the wrong number of
        arguments are passed.
        N(R RRR(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt/test_badNumberOfArgumentsToChangeVersionsScript	s	cCs&t}|jt|jdgdS(s
        L{changeVersionsScript} raises SystemExit when there are the wrong
        number of segments in the version number passed.
        s3.2.1.0N(R RRR(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt&test_tooManyDotsToChangeVersionsScript	s	cCs&t}|jt|jdgdS(sv
        L{changeVersionsScript} raises SystemExit when the version number isn't
        made out of numbers.
        smy united.states.of prewhateverN(R RRR(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt&test_nonIntPartsToChangeVersionsScript	s	cscgfd}t}||_|jddg|jtdtdfgdS(s
        L{BuildTarballsScript.main} invokes L{buildAllTarballs} with
        L{FilePath} instances representing the paths passed to it.
        csj||fdS(N(R(Rtdestination(R(sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt	myBuilder	stcheckoutDirtdestinationDirN(R!RRRCR(R8RttarballBuilder((RsD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_buildTarballsScript	s		cCs t}|j|jtdS(sw
        The default implementation of L{BuildTarballsScript.buildAllTarballs}
        is L{buildAllTarballs}.
        N(R!RCR(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt&test_defaultBuildTarballsScriptBuilder	s	cCs#t}|jt|jgdS(sv
        L{BuildTarballsScript.main} raises SystemExit when the wrong number of
        arguments are passed.
        N(R!RRR(R8R((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt(test_badNumberOfArgumentsToBuildTarballs	s	cCs?t}|jt|jg|jt|jddgdS(sn
        L{NewsBuilder.main} raises L{SystemExit} when other than 1 argument is
        passed to it.
        RtworldN(R"RRR(R8tnewsBuilder((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt$test_badNumberOfArgumentsToBuildNews	s	cCsHg}t}|j|_|jdg|j|tdgdS(s
        L{NewsBuilder.main} calls L{NewsBuilder.buildAll} with a L{FilePath}
        instance constructed from the path passed to it.
        s/foo/bar/bazN(R"RRRRCR(R8RR((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyttest_buildNews	s
	N(RQRRRSRRRRRRRRRRRRR(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyRy	s			
			
	
						
(TRSR2R|R6RRRRGtxml.domRRtdatetimeRttwisted.trial.unittestRttwisted.python.compatRttwisted.python.procutilsRttwisted.pythonRttwisted.python.filepathRttwisted.python.versionsRttwisted.python._releaseR	R
RRR
RRRRRRRRRRRRRRRRRRR R!R"tnameRRttwisted.lore.scriptsR$tImportErrorRtpydoctor.drivertpydoctortSyntaxErrorRtgetattrRYRR-tobjectR.RTRxRRRRRRRRZR`RRRR(((sD/usr/lib/python2.7/dist-packages/twisted/python/test/test_release.pyt<module>	s$	


!	$			P, \M-