Exemple #1
0
 def test_run_misparsed(self):
     self.setupStep(shell.TreeSize())
     self.expectCommands(
         ExpectShell(workdir='wkdir', command=['du', '-s', '-k', '.']) +
         ExpectShell.log('stdio', stdout='abcdef\n') + 0)
     self.expectOutcome(result=WARNINGS,
                        state_string="treesize unknown (warnings)")
     return self.runStep()
Exemple #2
0
 def test_run_failed(self):
     self.setupStep(shell.TreeSize())
     self.expectCommands(
         ExpectShell(workdir='wkdir', command=['du', '-s', '-k', '.']) +
         ExpectShell.log('stdio', stderr='abcdef\n') + 1)
     self.expectOutcome(result=FAILURE,
                        state_string="treesize unknown (failure)")
     return self.runStep()
Exemple #3
0
 def test_run_success(self):
     self.setupStep(shell.TreeSize())
     self.expectCommands(
         ExpectShell(workdir='wkdir', command=['du', '-s', '-k', '.']) +
         ExpectShell.log('stdio', stdout='9292    .\n') + 0)
     self.expectOutcome(result=SUCCESS, state_string="treesize 9292 KiB")
     self.expectProperty('tree-size-KiB', 9292)
     return self.runStep()
Exemple #4
0
 def test_run_failed(self):
     self.setupStep(shell.TreeSize())
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     usePTY='slave-config',
                     command=['du', '-s', '-k', '.']) +
         ExpectShell.log('stdio', stderr='abcdef\n') + 1)
     self.expectOutcome(result=FAILURE, status_text=["treesize", "unknown"])
     return self.runStep()
Exemple #5
0
 def test_run_failed(self):
     self.setup_step(shell.TreeSize())
     self.expect_commands(
         ExpectShell(workdir='wkdir',
                     command=['du', '-s', '-k',
                              '.']).stderr('abcdef\n').exit(1))
     self.expect_outcome(result=FAILURE,
                         state_string="treesize unknown (failure)")
     return self.run_step()
Exemple #6
0
 def test_run_misparsed(self):
     self.setup_step(shell.TreeSize())
     self.expect_commands(
         ExpectShell(workdir='wkdir',
                     command=['du', '-s', '-k',
                              '.']).stdout('abcdef\n').exit(0))
     self.expect_outcome(result=WARNINGS,
                         state_string="treesize unknown (warnings)")
     return self.run_step()
Exemple #7
0
 def test_run_success(self):
     self.setup_step(shell.TreeSize())
     self.expect_commands(
         ExpectShell(workdir='wkdir',
                     command=['du', '-s', '-k',
                              '.']).stdout('9292    .\n').exit(0))
     self.expect_outcome(result=SUCCESS, state_string="treesize 9292 KiB")
     self.expect_property('tree-size-KiB', 9292)
     return self.run_step()
Exemple #8
0
 def test_run_success(self):
     self.setupStep(shell.TreeSize())
     self.expectCommands(
         ExpectShell(workdir='wkdir',
                     usePTY='slave-config',
                     command=['du', '-s', '-k', '.']) +
         ExpectShell.log('stdio', stdout='9292    .\n') + 0)
     self.expectOutcome(result=SUCCESS,
                        status_text=["treesize", "9292 KiB"])
     self.expectProperty('tree-size-KiB', 9292)
     return self.runStep()
Exemple #9
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