def METHOD_NAME(self):
    input_buffer = "input buffer"
    output_buffer = "output buffer"
    self.mock_popen.return_value.returncode = 0
    self.mock_popen.return_value.communicate.return_value = (
        output_buffer,
        "Error",
    )
    optimizer = self.get_optimizer()
    return_buffer = optimizer.run_optimizer(".jpg", input_buffer)
    self.mock_popen.return_value.communicate.assert_called_with(
        input_buffer
    )
    self.assertEqual(output_buffer, return_buffer)