Пример #1
0
 def test_nochange(self):
     self.setupStep(python.Sphinx(sphinx_builddir="_build"))
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     command=['sphinx-build', '.', '_build']) +
         ExpectShell.log('stdio', stdout=log_output_nochange) + 0)
     self.expectOutcome(result=SUCCESS, state_string="sphinx 0 warnings")
     return self.runStep()
Пример #2
0
 def test_failure(self):
     self.setupStep(python.Sphinx(sphinx_builddir="_build"))
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     command=['sphinx-build', '.', '_build']) +
         ExpectShell.log('stdio', stdout='oh noes!') + 1)
     self.expectOutcome(result=FAILURE,
                        state_string="sphinx 0 warnings (failure)")
     return self.runStep()
Пример #3
0
 def test_nochange(self):
     self.setupStep(python.Sphinx(sphinx_builddir="_build"))
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     usePTY='slave-config',
                     command=['sphinx-build', '.', '_build']) +
         ExpectShell.log('stdio', stdout=log_output_nochange) + 0)
     self.expectOutcome(result=SUCCESS,
                        status_text=["sphinx", "0 warnings"])
     return self.runStep()
Пример #4
0
 def test_failure(self):
     self.setupStep(python.Sphinx(sphinx_builddir="_build"))
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     usePTY='slave-config',
                     command=['sphinx-build', '.', '_build']) +
         ExpectShell.log('stdio', stdout='oh noes!') + 1)
     self.expectOutcome(result=FAILURE,
                        status_text=["sphinx", "0 warnings", "failed"])
     return self.runStep()
Пример #5
0
 def test_success(self):
     self.setup_step(python.Sphinx(sphinx_builddir="_build"))
     self.expect_commands(
         ExpectShell(workdir='wkdir',
                     command=['sphinx-build', '.', '_build'])
         .stdout(log_output_success)
         .exit(0)
     )
     self.expect_outcome(result=SUCCESS, state_string="sphinx 0 warnings")
     return self.run_step()
Пример #6
0
 def test_strict_warnings(self):
     self.setupStep(
         python.Sphinx(sphinx_builddir="_build", strict_warnings=True))
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     command=['sphinx-build', '-W', '.', '_build']) +
         ExpectShell.log('stdio', stdout=log_output_warnings_strict) + 1)
     self.expectOutcome(result=FAILURE,
                        state_string="sphinx 1 warnings (failure)")
     return self.runStep()
Пример #7
0
 def test_strict_warnings(self):
     self.setup_step(python.Sphinx(sphinx_builddir="_build", strict_warnings=True))
     self.expect_commands(
         ExpectShell(workdir='wkdir',
                     command=['sphinx-build', '-W', '.', '_build'])
         .stdout(log_output_warnings_strict)
         .exit(1)
     )
     self.expect_outcome(result=FAILURE,
                        state_string="sphinx 1 warnings (failure)")
     return self.run_step()
Пример #8
0
 def test_failure(self):
     self.setup_step(python.Sphinx(sphinx_builddir="_build"))
     self.expect_commands(
         ExpectShell(workdir='wkdir',
                     command=['sphinx-build', '.', '_build'])
         .stdout('oh noes!')
         .exit(1)
     )
     self.expect_outcome(result=FAILURE,
                        state_string="sphinx 0 warnings (failure)")
     return self.run_step()
Пример #9
0
    def test_warnings(self):
        self.setupStep(python.Sphinx(sphinx_builddir="_build"))
        self.expectCommands(
            ExpectShell(workdir='wkdir',
                        command=['sphinx-build', '.', '_build']) +
            ExpectShell.log('stdio', stdout=log_output_warnings) + 0)
        self.expectOutcome(result=WARNINGS,
                           state_string="sphinx 2 warnings (warnings)")
        self.expectLogfile("warnings", warnings)
        yield self.runStep()

        self.assertEqual(self.step.statistics, {'warnings': 2})
Пример #10
0
    def test_warnings(self):
        self.setup_step(python.Sphinx(sphinx_builddir="_build"))
        self.expect_commands(
            ExpectShell(workdir='wkdir',
                        command=['sphinx-build', '.', '_build'])
            .stdout(log_output_warnings)
            .exit(0)
        )
        self.expect_outcome(result=WARNINGS,
                           state_string="sphinx 2 warnings (warnings)")
        self.expect_log_file("warnings", warnings)
        yield self.run_step()

        self.assertEqual(self.step.statistics, {'warnings': 2})
Пример #11
0
    def test_warnings(self):
        self.setupStep(python.Sphinx(sphinx_builddir="_build"))
        self.expectCommands(
            ExpectShell(workdir='wkdir',
                        usePTY='slave-config',
                        command=['sphinx-build', '.', '_build']) +
            ExpectShell.log('stdio', stdout=log_output_warnings) + 0)
        self.expectOutcome(result=WARNINGS,
                           status_text=["sphinx", "2 warnings", "warnings"])
        self.expectLogfile("warnings", warnings)
        d = self.runStep()

        def check(_):
            self.assertEqual(self.step_statistics, {'warnings': 2})

        d.addCallback(check)
        return d
Пример #12
0
 def test_constr_args(self):
     self.setupStep(
         python.Sphinx(sphinx_sourcedir='src',
                       sphinx_builddir="bld",
                       sphinx_builder='css',
                       sphinx="/path/to/sphinx-build",
                       tags=['a', 'b'],
                       defines=dict(empty=None, t=True, f=False, s="str"),
                       mode='full'))
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     command=[
                         '/path/to/sphinx-build', '-b', 'css', '-t', 'a',
                         '-t', 'b', '-D', 'empty', '-D', 'f=0', '-D',
                         's=str', '-D', 't=1', '-E', 'src', 'bld'
                     ]) +
         ExpectShell.log('stdio', stdout=log_output_success) + 0)
     self.expectOutcome(result=SUCCESS, state_string="sphinx 0 warnings")
     return self.runStep()
Пример #13
0
 def test_bad_mode(self):
     self.assertRaises(
         config.ConfigErrors,
         lambda: python.Sphinx(sphinx_builddir="_build", mode="don't care"))
Пример #14
0
 def test_builddir_required(self):
     self.assertRaises(config.ConfigErrors, lambda: python.Sphinx())
Пример #15
0
 def test_builddir_required(self):
     with self.assertRaises(config.ConfigErrors):
         python.Sphinx()