summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test__iotools.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2015-01-23 16:10:37 -0700
committerCharles Harris <charlesr.harris@gmail.com>2015-01-23 16:21:15 -0700
commit6bb48b0639322a0f5908996f33c98db62304b839 (patch)
tree52293d48bfda4401e47219844a401f7f1935f436 /numpy/lib/tests/test__iotools.py
parent4b1aab31cc66d4a5abd3d2d6b40e461cadd79d2a (diff)
downloadnumpy-6bb48b0639322a0f5908996f33c98db62304b839.tar.gz
MAINT: Make argument determination in NameValidator more precise.
The function was useing `'u' in case_sensitive` to detect `upper`. Make that more precise with `case_sensitive.startswith('u'). Raise ValueError if case_sensitive has unrecognized value.
Diffstat (limited to 'numpy/lib/tests/test__iotools.py')
-rw-r--r--numpy/lib/tests/test__iotools.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/numpy/lib/tests/test__iotools.py b/numpy/lib/tests/test__iotools.py
index 92ca1c973..060f815d5 100644
--- a/numpy/lib/tests/test__iotools.py
+++ b/numpy/lib/tests/test__iotools.py
@@ -7,7 +7,8 @@ from datetime import date
import numpy as np
from numpy.compat import asbytes, asbytes_nested
from numpy.testing import (
- run_module_suite, TestCase, assert_, assert_equal, assert_allclose
+ run_module_suite, TestCase, assert_, assert_equal, assert_allclose,
+ assert_raises
)
from numpy.lib._iotools import (
LineSplitter, NameValidator, StringConverter,
@@ -93,6 +94,9 @@ class TestNameValidator(TestCase):
test = NameValidator(case_sensitive='lower').validate(names)
assert_equal(test, ['a', 'a_1', 'b', 'c'])
+ # check exceptions
+ assert_raises(ValueError, NameValidator, case_sensitive='foobar')
+
def test_excludelist(self):
"Test excludelist"
names = ['dates', 'data', 'Other Data', 'mask']