def test_get_units(self): r"""Test get_units.""" for v in self._vars_nounits: self.assert_equal(units.get_units(v), '') for v in self._vars_units: self.assert_equal(units.get_units(v), str(units.as_unit('cm').units))
def test_as_unit(self): r"""Test as_unit.""" units.as_unit('cm') self.assert_raises(ValueError, units.as_unit, 'invalid')
def test_as_unit(self): r"""Test as_unit.""" units.as_unit('cm') with pytest.raises(ValueError): units.as_unit('invalid')
def test_get_units(self, vars_units, vars_nounits): r"""Test get_units.""" for v in vars_nounits: assert (units.get_units(v) == '') for v in vars_units: assert (units.get_units(v) == str(units.as_unit('cm').units))