def test_must_write_only_stdout(self): Container._write_container_output(self.output_itr, stdout=self.stdout_mock, stderr=None) self.stdout_mock.write.assert_has_calls([call(b"stdout1"), call(b"stdout2"), call(b"stdout3")]) self.stderr_mock.write.assert_not_called() # stderr must never be called
def test_must_write_only_stderr(self): # All the invalid frames must be ignored Container._write_container_output(self.output_itr, stdout=None, stderr=self.stderr_mock) self.stdout_mock.write.assert_not_called() self.stderr_mock.write.assert_has_calls([call(b"stderr1"), call(b"stderr2"), call(b"stderr3")])
def test_must_write_stdout_and_stderr_data(self): # All the invalid frames must be ignored Container._write_container_output(self.output_itr, stdout=self.stdout_mock, stderr=self.stderr_mock) self.stdout_mock.write.assert_has_calls([call(b"stdout1"), call(b"stdout2"), call(b"stdout3")]) self.stderr_mock.write.assert_has_calls([call(b"stderr1"), call(b"stderr2"), call(b"stderr3")])
def test_must_write_only_stdout(self): Container._write_container_output(self.output_itr, stdout=self.stdout_mock, stderr=None) self.stdout_mock.write.assert_has_calls([ call(b"stdout1"), call(b"stdout2"), call(b"stdout3") ]) self.stderr_mock.write.assert_not_called() # stderr must never be called
def test_must_write_only_stderr(self): # All the invalid frames must be ignored Container._write_container_output(self.output_itr, stdout=None, stderr=self.stderr_mock) self.stdout_mock.write.assert_not_called() self.stderr_mock.write.assert_has_calls([ call(b"stderr1"), call(b"stderr2"), call(b"stderr3") ])
def test_must_write_stdout_and_stderr_data(self): # All the invalid frames must be ignored Container._write_container_output(self.output_itr, stdout=self.stdout_mock, stderr=self.stderr_mock) self.stdout_mock.write.assert_has_calls([ call(b"stdout1"), call(b"stdout2"), call(b"stdout3") ]) self.stderr_mock.write.assert_has_calls([ call(b"stderr1"), call(b"stderr2"), call(b"stderr3") ])