def test_clean(self): stream = RunnerStream(Runner()) stream.clean()
def test_runner_stream(self): self.assertIsInstance(make_stream(Runner()), RunnerStream)
def test_creation(self): RunnerStream(Runner())
def test_begin(self): stream = RunnerStream(Runner()) self.assertEqual(stream.begin(), (None, subprocess.PIPE))
def test_run(self): collector = Collector() runner = Runner(collector, collector) self.assertEqual(runner.run(['printf', 'xxx\\nyyy\\nzzz']), 0) self.assertEqual(collector.items, ['xxx', 'yyy', 'zzz'])
def test_creation_not_implemented(self): runner = Runner() self.assertRaises(NotImplementedError, Streams, stdout=runner) self.assertRaises(NotImplementedError, Streams, stderr=runner)
def test_creation_default(self): Runner()
def test_creation_environment(self): Runner(Null, Null, {'PATH': '/home'})