def test_run_warnings(self):
     self.setupStep(python_twisted.HLint(workdir='build'),
                    buildFiles=['foo.xhtml'])
     self.expectCommands(
         ExpectShell(
             workdir='build',
             command=['bin/lore', '-p', '--output', 'lint', 'foo.xhtml']) +
         ExpectShell.log('stdio', stdout="colon: meaning warning\n") + 0)
     self.expectLogfile('warnings', 'colon: meaning warning')
     self.expectOutcome(result=WARNINGS, state_string='hlint (warnings)')
     return self.runStep()
Example #2
0
 def test_run_warnings(self):
     self.setup_step(python_twisted.HLint(workdir='build'),
                     build_files=['foo.xhtml'])
     self.expect_commands(
         ExpectShell(workdir='build',
                     command=[
                         'bin/lore', '-p', '--output', 'lint', 'foo.xhtml'
                     ]).stdout("colon: meaning warning\n").exit(0))
     self.expect_log_file('warnings', 'colon: meaning warning')
     self.expect_outcome(result=WARNINGS, state_string='1 hlint (warnings)')
     return self.run_step()
Example #3
0
 def test_command_failure(self):
     self.setup_step(python_twisted.HLint(workdir='build'),
                     build_files=['foo.xhtml'])
     self.expect_commands(
         ExpectShell(
             workdir='build',
             command=['bin/lore', '-p', '--output', 'lint', 'foo.xhtml'],
         ).exit(1))
     self.expect_log_file('files', 'foo.xhtml\n')
     self.expect_outcome(result=FAILURE, state_string='hlint (failure)')
     return self.run_step()
Example #4
0
 def test_run_ok(self):
     self.setup_step(python_twisted.HLint(workdir='build'),
                     build_files=['foo.xhtml'])
     self.expect_commands(
         ExpectShell(
             workdir='build',
             command=['bin/lore', '-p', '--output', 'lint', 'foo.xhtml'],
         ).stdout("dunno what hlint output looks like..\n").exit(0))
     self.expect_log_file('files', 'foo.xhtml\n')
     self.expect_outcome(result=SUCCESS, state_string='0 hlints')
     return self.run_step()
 def test_run_ok(self):
     self.setupStep(python_twisted.HLint(workdir='build'),
                    buildFiles=['foo.xhtml'])
     self.expectCommands(
         ExpectShell(
             workdir='build',
             command=['bin/lore', '-p', '--output', 'lint', 'foo.xhtml'],
         ) + ExpectShell.log(
             'stdio', stdout="dunno what hlint output looks like..\n") + 0)
     self.expectLogfile('files', 'foo.xhtml\n')
     self.expectOutcome(result=SUCCESS, state_string='hlint')
     return self.runStep()
Example #6
0
 def test_custom_python(self):
     self.setupStep(python_twisted.HLint(workdir='build', python='/bin/mypython'),
                    buildFiles=['foo.xhtml'])
     self.expectCommands(
         ExpectShell(workdir='build',
                     command=['/bin/mypython', 'bin/lore', '-p', '--output', 'lint',
                              'foo.xhtml'])
         + 0
     )
     self.expectLogfile('files', 'foo.xhtml\n')
     self.expectOutcome(result=SUCCESS, state_string='0 hlints')
     return self.runStep()
Example #7
0
 def testAllSteps(self):
     # make sure that steps can be created from the factories that they
     # return
     for s in (
             dummy.Dummy(),
             dummy.FailingDummy(),
             dummy.RemoteDummy(),
             maxq.MaxQ("testdir"),
             python.BuildEPYDoc(),
             python.PyFlakes(),
             python_twisted.HLint(),
             python_twisted.Trial(testpath=None, tests="tests"),
             python_twisted.ProcessDocs(),
             python_twisted.BuildDebs(),
             python_twisted.RemovePYCs(),
             shell.ShellCommand(),
             shell.TreeSize(),
             shell.Configure(),
             shell.Compile(),
             shell.Test(),
             source.CVS("cvsroot", "module"),
             source.SVN("svnurl"),
             source.Darcs("repourl"),
             source.Git("repourl"),
             source.Arch("url", "version"),
             source.Bazaar("url", "version", "archive"),
             source.Bzr("repourl"),
             source.Mercurial("repourl"),
             source.P4("p4base"),
             source.P4Sync(1234, "p4user", "passwd", "client", mode="copy"),
             source.Monotone("server", "branch"),
             transfer.FileUpload("src", "dest"),
             transfer.FileDownload("src", "dest"),
     ):
         try:
             self._loop(s)
         except:
             print "error checking %s" % s
             raise
Example #8
0
 def test_no_build_files(self):
     self.setup_step(python_twisted.HLint(workdir='build'))
     self.expect_outcome(result=SKIPPED, state_string='hlint (skipped)')
     return self.run_step()