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

Method test_dialect_apply

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

Source from the content-addressed store, hash-verified

665
666 @unittest.expectedFailure # TODO: RUSTPYTHON
667 def test_dialect_apply(self):
668 class testA(csv.excel):
669 delimiter = "\t"
670 class testB(csv.excel):
671 delimiter = ":"
672 class testC(csv.excel):
673 delimiter = "|"
674 class testUni(csv.excel):
675 delimiter = "\u039B"
676
677 class unspecified():
678 # A class to pass as dialect but with no dialect attributes.
679 pass
680
681 csv.register_dialect('testC', testC)
682 try:
683 self.compare_dialect_123("1,2,3\r\n")
684 self.compare_dialect_123("1,2,3\r\n", dialect=None)
685 self.compare_dialect_123("1,2,3\r\n", dialect=unspecified)
686 self.compare_dialect_123("1\t2\t3\r\n", testA)
687 self.compare_dialect_123("1:2:3\r\n", dialect=testB())
688 self.compare_dialect_123("1|2|3\r\n", dialect='testC')
689 self.compare_dialect_123("1;2;3\r\n", dialect=testA,
690 delimiter=';')
691 self.compare_dialect_123("1\u039B2\u039B3\r\n",
692 dialect=testUni)
693
694 finally:
695 csv.unregister_dialect('testC')
696
697 def test_copy(self):
698 for name in csv.list_dialects():

Callers

nothing calls this directly

Calls 2

compare_dialect_123Method · 0.95
testBClass · 0.70

Tested by

no test coverage detected