def test_sheet_writer_to_memory(self): io = get_io(self.file_type) w = CSVSheetWriter(io, None, single_sheet_in_book=True) for row in self.data: w.write_row(row) w.close() content = io.getvalue().replace('\r', '') assert content.strip('\n') == self.result
def test_sheet_writer(self): w = CSVSheetWriter(self.test_file, None) for row in self.data: w.write_row(row) w.close() with open(self.test_file, 'r') as f: content = f.read().replace('\r', '') assert content.strip('\n') == self.result