def __roundtrip(self, records, expect_diagnostics): file_obj = six.StringIO() db._write_csv_file(file_obj, records) file_obj.seek(0) read_records, diagnostics = db._parse_csv_file(file_obj) self.assertEqual(records, read_records) self.__assertDiag(diagnostics, expect_diagnostics)
def __roundtrip(self, records, expect_diagnostics): file_obj = StringIO.StringIO() db._write_csv_file(file_obj, records) file_obj.seek(0) read_records, diagnostics = db._parse_csv_file(file_obj) self.assertEqual(records, read_records) self.__assertDiag(diagnostics, expect_diagnostics)
def __parse(self, s, expect_records, expect_diagnostics): read_records, diagnostics = db._parse_csv_file(six.StringIO(s)) self.__assertDiag(diagnostics, expect_diagnostics) self.assertEqual(expect_records, read_records)
def __parse(self, s, expect_records, expect_diagnostics): read_records, diagnostics = db._parse_csv_file(StringIO.StringIO(s)) self.__assertDiag(diagnostics, expect_diagnostics) self.assertEqual(expect_records, read_records)