コード例 #1
0
 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)
コード例 #2
0
 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