import model
import unittest
import snake
import time
from model import Geoposition
class Geoposition_TestCase(unittest.TestCase):
def test_canGreateGeoposition(self):
a = Geoposition(1.5, 2.0)
self.assertAlmostEqual(1.5, a.latitude)
self.assertAlmostEqual(2.0, a.longitude)
def test_poleProblem(self):
target = Geoposition( -1.57062, 0.047123)
p = Geoposition(-0.783933, 7.96195e-008)
for i in xrange(1, 5):
print str(p)
a = p.getAzimuth(target)
print "Azimuth: %f" % a
p = p.getEndpoint(a, 1000)
s = "%f" % a
self.assertNotEqual("-1.#IND00", s)
tests = unittest.TestSuite()
snake.unittest.addTests(tests, Geoposition_TestCase)