MCPcopy Create free account
hub / github.com/numpy/numpy / test_other_delimiter

Method test_other_delimiter

numpy/lib/tests/test__iotools.py:46–59  ·  view source on GitHub ↗

Test LineSplitter on delimiter

(self)

Source from the content-addressed store, hash-verified

44 assert_equal(test, ['1 2', '3 4', '5 6'])
45
46 def test_other_delimiter(self):
47 "Test LineSplitter on delimiter"
48 strg = "1,2,3,4,,5"
49 test = LineSplitter(',')(strg)
50 assert_equal(test, ['1', '2', '3', '4', '', '5'])
51 #
52 strg = " 1,2,3,4,,5 # test"
53 test = LineSplitter(',')(strg)
54 assert_equal(test, ['1', '2', '3', '4', '', '5'])
55
56 # gh-11028 bytes comment/delimiters should get encoded
57 strg = b" 1,2,3,4,,5 % test"
58 test = LineSplitter(delimiter=b',', comments=b'%')(strg)
59 assert_equal(test, ['1', '2', '3', '4', '', '5'])
60
61 def test_constant_fixed_width(self):
62 "Test LineSplitter w/ fixed-width fields"

Callers

nothing calls this directly

Calls 2

LineSplitterClass · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected