def test_negativeClimbs(self): """ Climbs can have negative values, and still report that value in meters per second and when converted to floats. """ climb = base.Climb(-42.) self.assertEqual(climb.inMetersPerSecond, -42.) self.assertEqual(float(climb), -42.)
def test_simple(self): """ Speeds can be instantiated, and report their value in meters per second, and can be converted to floats. """ climb = base.Climb(42.) self.assertEqual(climb.inMetersPerSecond, 42.) self.assertEqual(float(climb), 42.)
def test_asFloat(self): """ A climb can be converted into a C{float}. """ self.assertEqual(1.0, float(base.Climb(1.0)))
def test_speedInKnots(self): """ A climb can be converted into its value in knots. """ climb = base.Climb(1.0) self.assertEqual(1 / base.MPS_PER_KNOT, climb.inKnots)
def test_repr(self): """ Climbs report their type and value in their repr. """ climb = base.Climb(42.) self.assertEqual(repr(climb), "<Climb (42.0 m/s)>")