def test_simple_functionality(self): data = "\n\nwhee\n" test_file = mock.SaveDataAfterCloseStringIO() utils.open.expect_call("filename", "w").and_return(test_file) utils.open_write_close("filename", data) self.god.check_playback() self.assertEqual(data, test_file.final_data)
def get_write_one_line_output(self, content): test_file = mock.SaveDataAfterCloseStringIO() utils.open.expect_call("filename", "w").and_return(test_file) utils.write_one_line("filename", content) self.god.check_playback() return test_file.final_data