'Mocks and saves the stdout & stderr output'

def mock_io(self):

    self.orig_stdout = sys.stdout
    self.orig_stderr = sys.stderr
    self.mock_streams_stdout = StringIO.StringIO('')
    self.mock_streams_stderr = StringIO.StringIO('')
    sys.stdout = self.mock_streams_stdout
    sys.stderr = self.mock_streams_stderr
