def test_create_processes_two(self): mock_process_1 = mock.Mock() mock_process_2 = mock.Mock() pipeline = Pipeline([mock_process_1, mock_process_2]) processes = pipeline.create_processes('in', 'out') self.assertEqual(len(processes), 2) mock_process_1.run.assert_called_once_with(stdin='in', stdout=PIPE) mock_process_2.run.assert_called_once_with( stdin=mock_process_1.run().stdout, stdout='out' )
def test_create_processes_single(self): mock_process = mock.Mock() pipeline = Pipeline([mock_process]) processes = pipeline.create_processes('in', 'out') self.assertEqual(len(processes), 1) mock_process.run.assert_called_once_with(stdin='in', stdout='out')