Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _read_test(self, table, dialect):
tmpfname = self._write_tmpfile(table, dialect)
exp = [list(map(str, r)) for r in table]
try:
self.assertEqual(exp, wrappers.read_csv(tmpfname))
finally:
os.unlink(tmpfname)
def _read_test(self, table, dialect):
tmpfname = self._write_tmpfile(table, dialect)
exp = [list(map(str, r)) for r in table]
try:
self.assertEqual(exp, wrappers.read_csv(tmpfname))
finally:
os.unlink(tmpfname)
def _read_test_rows(self, rows, expected):
contents = "\n".join(rows)
tmpfd, tmpfname = tempfile.mkstemp(prefix="ccsv_", suffix=".csv")
tmpid = os.fdopen(tmpfd, "w")
tmpid.write(contents)
tmpid.close()
try:
self.assertEqual(expected, wrappers.read_csv(tmpfname))
finally:
os.unlink(tmpfname)
def _read_test_rows(self, rows, expected):
contents = "\n".join(rows)
tmpfd, tmpfname = tempfile.mkstemp(prefix="ccsv_", suffix=".csv")
tmpid = os.fdopen(tmpfd, "w")
tmpid.write(contents)
tmpid.close()
try:
self.assertEqual(expected, wrappers.read_csv(tmpfname))
finally:
os.unlink(tmpfname)