Пример #1
0
 def _assert_almost_equal_convert(value, u1, u2, ref):
     assert_almost_equal(units.convert(value, u1, u2), ref,
                         err_msg="Conversion {0} --> {1} failed".format(u1, u2))
Пример #2
0
 def test_unit_unconvertable(self):
     nm = 12.34567
     A = nm * 10.
     with pytest.raises(ValueError):
         units.convert(A, 'A', 'ps')
Пример #3
0
 def test_unit_unconvertable(self):
     nm = 12.34567
     A = nm * 10.
     with pytest.raises(ValueError):
         units.convert(A, 'A', 'ps')
Пример #4
0
 def test_unit_unknown(self, quantity, unit1, unit2):
     with pytest.raises(ValueError):
         units.convert(quantity, unit1, unit2)
Пример #5
0
 def test_unit_unknown(self, quantity, unit1, unit2):
     with pytest.raises(ValueError):
         units.convert(quantity, unit1, unit2)