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

Method test_other_delimiter

numpy/lib/tests/test__iotools.py:42–55  ·  view source on GitHub ↗

Test LineSplitter on delimiter

(self)

Source from the content-addressed store, hash-verified

40 assert_equal(test, ['1 2', '3 4', '5 6'])
41
42 def test_other_delimiter(self):
43 "Test LineSplitter on delimiter"
44 strg = "1,2,3,4,,5"
45 test = LineSplitter(',')(strg)
46 assert_equal(test, ['1', '2', '3', '4', '', '5'])
47 #
48 strg = " 1,2,3,4,,5 # test"
49 test = LineSplitter(',')(strg)
50 assert_equal(test, ['1', '2', '3', '4', '', '5'])
51
52 # gh-11028 bytes comment/delimiters should get encoded
53 strg = b" 1,2,3,4,,5 % test"
54 test = LineSplitter(delimiter=b',', comments=b'%')(strg)
55 assert_equal(test, ['1', '2', '3', '4', '', '5'])
56
57 def test_constant_fixed_width(self):
58 "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