def test_headingWithoutVariationRepr(self): """ A repr of a heading with no variation reports its value and that the variation is unknown. """ heading = base.Heading(1.) expectedRepr = "<Heading (1.0 degrees, unknown variation)>" self.assertEqual(repr(heading), expectedRepr)
def test_simple(self): """ Tests that a simple heading has a value in decimal degrees, which is also its value when converted to a float. Its variation, and by consequence its corrected heading, is C{None}. """ h = base.Heading(1.) self.assertEqual(h.inDecimalDegrees, 1.) self.assertEqual(float(h), 1.) self.assertEqual(h.variation, None) self.assertEqual(h.correctedHeading, None)
def test_zeroHeadingEdgeCase(self): """ Headings can be instantiated with a value of 0 and no variation. """ base.Heading(0)
def test_valueInequality(self): """ Headings with different values compare unequal. """ self.assertNotEqual(base.Heading(1.), base.Heading(2.))
def test_valueEquality(self): """ Headings with the same values compare equal. """ self.assertEqual(base.Heading(1.), base.Heading(1.))
def test_zeroHeading180DegreeVariationEdgeCase(self): """ Headings can be instantiated with a value of 0 and a variation of 180 degrees. """ base.Heading(0, 180)