Example #1
0
 def testCheckOutputStr(self):
     coro = check_output("echo ok", shell=True, universal_newlines=True)
     stdout = asyncio.get_event_loop().run_until_complete(coro)
     self.assertEqual(stdout, "ok\n")
Example #2
0
 def testCheckOutputFail(self):
     from subprocess import CalledProcessError
     coro = check_output(["/bin/false"])
     self.assertRaises(CalledProcessError,
                       asyncio.get_event_loop().run_until_complete, coro)
Example #3
0
 def testCheckOutputBin(self):
     coro = check_output("echo ok", shell=True)
     stdout = asyncio.get_event_loop().run_until_complete(coro)
     self.assertEqual(stdout, b'ok\n')