diff options
Diffstat (limited to 'numpy/lib/tests/test__iotools.py')
-rw-r--r-- | numpy/lib/tests/test__iotools.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/lib/tests/test__iotools.py b/numpy/lib/tests/test__iotools.py index bb1483186..2cb8461c3 100644 --- a/numpy/lib/tests/test__iotools.py +++ b/numpy/lib/tests/test__iotools.py @@ -142,6 +142,14 @@ class TestStringConverter(TestCase): assert_equal(test, date(2009, 01, 01)) test = convert('') assert_equal(test, date(2000, 01, 01)) + # + def test_string_to_object(self): + "Make sure that string-to-object functions are properly recognized" + from datetime import date + import time + conv = StringConverter(lambda s: date(*(time.strptime(s)[:3]))) + assert_equal(conv._mapper[-2][0](0), 0j) + assert(hasattr(conv, 'default')) #------------------------------------------------------------------------------- |