MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_space_dialect

Method test_space_dialect

Lib/test/test_csv.py:644–655  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

642 self.assertRaises(csv.Error, myexceltsv)
643
644 def test_space_dialect(self):
645 class space(csv.excel):
646 delimiter = " "
647 quoting = csv.QUOTE_NONE
648 escapechar = "\\"
649
650 with TemporaryFile("w+", encoding="utf-8") as fileobj:
651 fileobj.write("abc def\nc1ccccc1 benzene\n")
652 fileobj.seek(0)
653 reader = csv.reader(fileobj, dialect=space())
654 self.assertEqual(next(reader), ["abc", "", "", "def"])
655 self.assertEqual(next(reader), ["c1ccccc1", "benzene"])
656
657 def compare_dialect_123(self, expected, *writeargs, **kwwriteargs):
658

Callers

nothing calls this directly

Calls 7

TemporaryFileFunction · 0.90
spaceClass · 0.85
nextFunction · 0.85
writeMethod · 0.45
seekMethod · 0.45
readerMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected