def test_importlib(self):
        
        #check to make sure the import function errors if not all
        # required base_units are there
        unitLib_test_bad = resource_stream(units.__name__,
                                           'test/unitLib_test_badbaseunits.ini')
        try:
            units.import_library(unitLib_test_bad)
        except ValueError, err:
            self.assertEqual(str(err),
                             "Not all required base type were present in the"
                             " config file. missing: ['mass', 'time'], at least"
                             " ['length', 'mass', 'time', 'temperature',"
                             " 'angle'] required")
        else:
            self.fail("ValueError expected")

        #check to make sure that bad units in the units list cause an error    
        unitLib_test_bad = resource_stream(units.__name__,
                                           'test/unitLib_test_badunit.ini')
        try:
            units.import_library(unitLib_test_bad)
        except __HOLE__, err:
            self.assertEqual(str(err),
                             "The following units were not defined because"
                             " they could not be resolved as a function of any"
                             " other defined units:['foo']")
        else:
            self.fail("ValueError expected")
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.units/openmdao/units/test/test_units.py/test_moduleLevelFunctions.test_importlib