Exemplo n.º 1
0
    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
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
 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())
Exemplo n.º 4
0
 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())
Exemplo n.º 5
0
 def check(ign):
     self.failUnless({'stdout': nl('a\nb\n')} in b.updates, b.show())
     self.failUnless({'rc': 0} in b.updates, b.show())
Exemplo n.º 6
0
 def check(ign):
     self.failUnless({'stdout': nl(repr(args))} in b.updates, b.show())
     self.failUnless({'rc': 0} in b.updates, b.show())
Exemplo n.º 7
0
 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'))
Exemplo n.º 8
0
 def check(ign):
     self.failIf({'stderr': nl('hello\n')} not in b.updates, b.show())
     self.failUnless({'rc': 0} in b.updates, b.show())