def test_adding_2(self): mr_job = MRIncrementerJob(['-r', 'inline', '--times', '2']) mr_job.sandbox(stdin=BytesIO(b'0\n1\n2\n')) self.assertEqual(len(mr_job.steps()), 2) with mr_job.make_runner() as runner: assert isinstance(runner, InlineMRJobRunner) self.assertEqual(runner._get_steps(), [ { 'type': 'streaming', 'mapper': { 'type': 'script', } }, { 'type': 'streaming', 'mapper': { 'type': 'script', } }, ]) runner.run() output = sorted( v for k, v in mr_job.parse_output(runner.cat_output())) self.assertEqual(output, [2, 3, 4])