class_docstr: Test StringConverter
class_docstr_tok: ["Test","StringConverter"]
docstr: Tests updatemapper
docstr_tok: ["Tests","updatemapper"]
code: def test_upgrademapper(self):
      "Tests updatemapper"
      dateparser = _bytes_to_date
      _original_mapper = StringConverter._mapper[:]
      try:
          StringConverter.upgrade_mapper(dateparser, date(2000, 1, 1))
          convert = StringConverter(dateparser, date(2000, 1, 1))
          test = convert("2001-01-01")
          assert_equal(test, date(2001, 1, 1))
          test = convert("2009-01-01")
          assert_equal(test, date(2009, 1, 1))
          test = convert("")
          assert_equal(test, date(2000, 1, 1))
      finally:
          StringConverter._mapper = _original_mapper
  
imports: import time
  from datetime import date
  import numpy
  from numpy.testing import assert_, assert_equal, assert_allclose, assert_raises
  from numpy.lib._iotools import LineSplitter, NameValidator, StringConverter, has_nested_fields, easy_dtype, flatten_dtype
label_desc: Use image node_id 4 for calling the TestStringConverter obj's underlying member method code with example usage: obj.test_upgrademapper() without return types