MCPcopy Index your code
hub / github.com/numpy/numpy / test_case_sensitivity

Method test_case_sensitivity

numpy/lib/tests/test__iotools.py:89–102  ·  view source on GitHub ↗

Test case sensitivity

(self)

Source from the content-addressed store, hash-verified

87class TestNameValidator:
88
89 def test_case_sensitivity(self):
90 "Test case sensitivity"
91 names = ['A', 'a', 'b', 'c']
92 test = NameValidator().validate(names)
93 assert_equal(test, ['A', 'a', 'b', 'c'])
94 test = NameValidator(case_sensitive=False).validate(names)
95 assert_equal(test, ['A', 'A_1', 'B', 'C'])
96 test = NameValidator(case_sensitive='upper').validate(names)
97 assert_equal(test, ['A', 'A_1', 'B', 'C'])
98 test = NameValidator(case_sensitive='lower').validate(names)
99 assert_equal(test, ['a', 'a_1', 'b', 'c'])
100
101 # check exceptions
102 assert_raises(ValueError, NameValidator, case_sensitive='foobar')
103
104 def test_excludelist(self):
105 "Test excludelist"

Callers

nothing calls this directly

Calls 4

NameValidatorClass · 0.90
assert_equalFunction · 0.90
assert_raisesFunction · 0.90
validateMethod · 0.80

Tested by

no test coverage detected