def test_write_to_file(self): events = [ SrtEvent.from_string(SINGLE_LINE_SRT_EVENT), SrtEvent.from_string(MULTILINE_SRT_EVENT) ] SrtScript(events).save_to_file(self.script_path) with open(self.script_path) as script: text = script.read() self.assertEquals(SINGLE_LINE_SRT_EVENT + "\n\n" + MULTILINE_SRT_EVENT, text)