def method(testcase): testcase.expectCommands(Expect("command")) testcase.expectCommands(Expect("command2")) d = utils.getProcessOutputAndValue("command", ()) d.addCallback(self.assertEqual, ('', '', 0)) d.addCallback(lambda _: testcase.assertAllCommandsRan()) return d
def method(testcase): testcase.expectCommands(Expect("command")) testcase.addGetProcessOutputExpectEnv({'key': 'value'}) d = utils.getProcessOutput("command", (), env={'key': 'value'}) d.addCallback(self.assertEqual, '') d.addCallback(lambda _: testcase.assertAllCommandsRan()) return d
def method(testcase): testcase.expectCommands(Expect("command")) testcase.addGetProcessOutputExpectEnv({'key': 'value'}) res = yield utils.getProcessOutput("command", (), env={'key': 'value'}) self.assertEqual(res, b'') testcase.assertAllCommandsRan()
def method(testcase): testcase.expectCommands( Expect("command").stdout(b"stdout").stderr(b"stderr")) res = yield utils.getProcessOutput("command", (), errortoo=True) testcase.assertSubstring(b"stdout", res) testcase.assertSubstring(b"stderr", res)
def method(testcase): testcase.expectCommands(Expect("command").stdout("stdout").stderr("stderr")) d = utils.getProcessOutput("command", (), errortoo=True) @d.addCallback def cb(res): testcase.assertSubstring("stdout", res) testcase.assertSubstring("stderr", res) return d
def method(testcase): testcase.expectCommands(Expect("command").stderr("some test")) d = testcase.assertFailure(utils.getProcessOutput("command", ()), [IOError]) return d
def method(testcase): testcase.expectCommands(Expect("command", "arg").path("/home")) d = utils.getProcessOutput("command", ("otherarg", )) d.addCallback(lambda _: testcase.assertAllCommandsRan()) return d
def method(testcase): testcase.expectCommands(Expect("command").stderr(b"some test")) res = yield utils.getProcessOutput("command", (), errortoo=True) testcase.assertEqual(res, b"some test")
def method(testcase): testcase.expectCommands( Expect("command").stdout("stdout").stderr("stderr")) d = utils.getProcessOutputAndValue("command", ()) d.addCallback(testcase.assertEqual, ("stdout", 'stderr', 0)) return d
def method(testcase): testcase.expectCommands(Expect("command").stderr("some test")) d = utils.getProcessOutputAndValue("command", ()) d.addCallback(self.assertEqual, ('', 'some test', 0)) return d
def method(testcase): testcase.expectCommands(Expect("command").exit(1)) res = yield utils.getProcessOutputAndValue("command", ()) self.assertEqual(res, (b'', b'', 1))
def method(testcase): testcase.expectCommands(Expect("command").stderr(b"some test")) res = yield utils.getProcessOutputAndValue("command", ()) self.assertEqual(res, (b'', b'some test', 0))
def method(testcase): testcase.expectCommands(Expect("command", "arg")) yield utils.getProcessOutputAndValue("command", ("otherarg", ), path="/work") testcase.assertAllCommandsRan()
def method(testcase): testcase.expectCommands(Expect("command2")) yield utils.getProcessOutputAndValue("command", ()) testcase.assertAllCommandsRan()
def method(testcase): testcase.expectCommands(Expect("command").stdout(b"stdout")) res = yield utils.getProcessOutput("command", ()) testcase.assertEqual(res, b"stdout")
def method(testcase): testcase.expectCommands(Expect("command").stderr("some test")) d = utils.getProcessOutput("command", (), errortoo=True) d.addCallback(testcase.assertEqual, "some test") return d
def method(testcase): testcase.expectCommands(Expect("command").stdout("stdout")) d = utils.getProcessOutput("command", ()) d.addCallback(testcase.assertEqual, "stdout") return d
def method(testcase): testcase.expectCommands( Expect("command").stdout(b"stdout").stderr(b"stderr")) res = yield utils.getProcessOutputAndValue("command", ()) testcase.assertEqual(res, (b"stdout", b'stderr', 0))
def method(testcase): testcase.expectCommands(Expect("command")) testcase.addGetProcessOutputExpectEnv({'key': 'value'}) d = utils.getProcessOutput("command", ()) return d
def method(testcase): testcase.expectCommands(Expect("command")) res = yield utils.getProcessOutput("command", ()) self.assertEqual(res, b'') testcase.assertAllCommandsRan()
def method(testcase): testcase.expectCommands(Expect("command", "arg")) d = utils.getProcessOutputAndValue("command", ("otherarg", ), path="/work") d.addCallback(lambda _: testcase.assertAllCommandsRan()) return d
def test_methodChaining(self): expect = Expect('command') self.assertEqual(expect, expect.exit(0)) self.assertEqual(expect, expect.stdout("output")) self.assertEqual(expect, expect.stderr("error"))
def method(testcase): testcase.expectCommands(Expect("command").exit(1)) d = utils.getProcessOutputAndValue("command", ()) d.addCallback(self.assertEqual, ('', '', 1)) return d
def method(testcase): testcase.expectCommands(Expect("command2")) d = utils.getProcessOutput("command", ()) return d
def method(testcase): testcase.expectCommands(Expect("command", "arg").path("/home")) yield utils.getProcessOutput("command", ("otherarg", )) testcase.assertAllCommandsRan()