Пример #1
0
    def test_comparing_derived_with_derived_force_less(self):
        f1 = quantity.Force(1, "kg m s-2")
        f2 = quantity.Force(2, "kg m s-2")

        self.assertFalse(f1 == f2)
        self.assertTrue(f1 <= f2)
        self.assertFalse(f1 >= f2)
        self.assertFalse(f1 > f2)
        self.assertTrue(f1 < f2)
        self.assertTrue(f1 != f2)
Пример #2
0
 def test_force_name_kg_m_s2(self):
     f = quantity.Force(2, "kg m s-2")
     self.assertEquals(str(f), "2.0 kg m s\u207B\u00B2")
Пример #3
0
 def test_convert_force(self):
     f = quantity.Force(1.0, 'kg m s-2')
     self.assertEqual(f('lb yd s-2'),
                      float('2.412061728866277343179999663'))