def test_buildPDFRunsLaTeXThreeTimes(self):
        class InspectableBookBuilder(BookBuilder):
            def __init__(self):
                BookBuilder.__init__(self)
                self.commands = []

            def run(self, command):
                """
                Record the command and then execute it.
                """
                self.commands.append(command)
                return BookBuilder.run(self, command)

        bookPath = self._setupTeXFiles()
        outputPath = FilePath(self.mktemp())

        builder = InspectableBookBuilder()
        builder.buildPDF(bookPath, self.howtoDir, outputPath)

        # These string comparisons are very fragile.  It would be better to
        # have a test which asserted the correctness of the contents of the
        # output files.  I don't know how one could do that, though. -exarkun
        latex1, latex2, latex3, dvips, ps2pdf13 = builder.commands
        self.assertEquals(latex1, latex2)
        self.assertEquals(latex2, latex3)
        self.assertEquals(
            latex1[:1], ["latex"],
            "LaTeX command %r does not seem right." % (latex1,))
        self.assertEquals(
            latex1[-1:], [bookPath.path],
            "LaTeX command %r does not end with the book path (%r)." % (
                latex1, bookPath.path))

        self.assertEquals(
            dvips[:1], ["dvips"],
            "dvips command %r does not seem right." % (dvips,))
        self.assertEquals(
            ps2pdf13[:1], ["ps2pdf13"],
            "ps2pdf13 command %r does not seem right." % (ps2pdf13,))
L{BookBuilder.buildPDF} runs C{latex} three times.
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/python/test/test_release.py/BookBuilderTests.test_buildPDFRunsLaTeXThreeTimes