def testMultiWordStringCommandQuotes(self): b = FakeWorkerBuilder(False, self.basedir) # careful! This command must execute the same on windows and UNIX s = runprocess.RunProcess(b, 'echo "Happy Days and Jubilation"', self.basedir) if runtime.platformType == "win32": # echo doesn't parse out the quotes, so they come through in the # output exp = nl('"Happy Days and Jubilation"\n') else: exp = nl('Happy Days and Jubilation\n') d = s.start() def check(ign): self.failUnless({'stdout': exp} in b.updates, b.show()) self.failUnless({'rc': 0} in b.updates, b.show()) d.addCallback(check) return d
def testMultiWordStringCommand(self): b = FakeWorkerBuilder(False, self.basedir) # careful! This command must execute the same on windows and UNIX s = runprocess.RunProcess(b, 'echo Happy Days and Jubilation', self.basedir) # no quoting occurs exp = nl('Happy Days and Jubilation\n') d = s.start() def check(ign): self.failUnless({'stdout': exp} in b.updates, b.show()) self.failUnless({'rc': 0} in b.updates, b.show()) d.addCallback(check) return d
def testSendStatus(self): b = FakeWorkerBuilder(False, self.basedir) s = runprocess.RunProcess(b, stdoutCommand('hello'), self.basedir) s.sendStatus({'stdout': nl('hello\n')}) self.failUnlessEqual(b.updates, [{'stdout': nl('hello\n')}], b.show())
def check(ign): self.failUnless({'stdout': nl('hello\n')} not in b.updates, b.show()) self.failUnless({'rc': FATAL_RC} in b.updates, b.show())
def check(ign): self.failUnless({'stdout': nl('a\nb\n')} in b.updates, b.show()) self.failUnless({'rc': 0} in b.updates, b.show())
def check(ign): self.failUnless({'stdout': nl(repr(args))} in b.updates, b.show()) self.failUnless({'rc': 0} in b.updates, b.show())
def check(ign): self.failUnless({'stderr': nl('hello\n')} in b.updates, b.show()) self.failUnless({'rc': 0} in b.updates, b.show()) self.failUnlessEquals(s.stderr, nl('hello\n'))
def check(ign): self.failIf({'stderr': nl('hello\n')} not in b.updates, b.show()) self.failUnless({'rc': 0} in b.updates, b.show())