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

Method test_constant_fixed_width

numpy/lib/tests/test__iotools.py:57–69  ·  view source on GitHub ↗

Test LineSplitter w/ fixed-width fields

(self)

Source from the content-addressed store, hash-verified

55 assert_equal(test, ['1', '2', '3', '4', '', '5'])
56
57 def test_constant_fixed_width(self):
58 "Test LineSplitter w/ fixed-width fields"
59 strg = " 1 2 3 4 5 # test"
60 test = LineSplitter(3)(strg)
61 assert_equal(test, ['1', '2', '3', '4', '', '5', ''])
62 #
63 strg = " 1 3 4 5 6# test"
64 test = LineSplitter(20)(strg)
65 assert_equal(test, ['1 3 4 5 6'])
66 #
67 strg = " 1 3 4 5 6# test"
68 test = LineSplitter(30)(strg)
69 assert_equal(test, ['1 3 4 5 6'])
70
71 def test_variable_fixed_width(self):
72 strg = " 1 3 4 5 6# test"

Callers

nothing calls this directly

Calls 2

LineSplitterClass · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected