Ejemplo n.º 1
0
 def test_000_052_shouldHandleNumLat(self):
     test_input = {
         'lat': 1,
         'long': '95d41.6',
         'altitude': '13d42.3',
         'assumedLat': '-53d38.4',
         'assumedLong': '74d35.3'
     }
     expected = {
         'lat': 1,
         'long': '95d41.6',
         'altitude': '13d42.3',
         'assumedLat': '-53d38.4',
         'assumedLong': '74d35.3',
         'error': 'lat is invalid'
     }
     actual = correct.correct(test_input)
     self.assertEqual(expected, actual)
Ejemplo n.º 2
0
 def test_000_054_shouldHandleHighLon(self):
     test_input = {
         'lat': '16d32.3',
         'long': '360d0.0',
         'altitude': '13d42.3',
         'assumedLat': '-53d38.4',
         'assumedLong': '74d35.3'
     }
     expected = {
         'lat': '16d32.3',
         'long': '360d0.0',
         'altitude': '13d42.3',
         'assumedLat': '-53d38.4',
         'assumedLong': '74d35.3',
         'error': 'long is invalid'
     }
     actual = correct.correct(test_input)
     self.assertEqual(expected, actual)
Ejemplo n.º 3
0
 def test_000_053_shouldHandleLowLon(self):
     test_input = {
         'lat': '16d32.3',
         'long': '95d41.6',
         'altitude': '13d42.3',
         'assumedLat': '-53d38.4',
         'assumedLong': '74d35.3'
     }
     expected = {
         'lat': '16d32.3',
         'long': '95d41.6',
         'altitude': '13d42.3',
         'assumedLat': '-53d38.4',
         'assumedLong': '74d35.3',
         'correctedAzimuth': '164d42.9',
         'correctedDistance': '3950'
     }
     actual = correct.correct(test_input)
     self.assertEqual(expected, actual)
Ejemplo n.º 4
0
 def test100_020_ShouldPassDictionaryWithAddedEntry(self):
     sighting = dict()
     sighting['op'] = 'correct'
     sighting['extra'] = 'ignore me'
     actual = correct.correct(sighting)
     self.assertEqual(actual, sighting, 'Should return unmodified')
Ejemplo n.º 5
0
 def test100_010_ShouldPassPlainDictionary(self):
     sighting = dict()
     sighting['op'] = 'correct'
     actual = correct.correct(sighting)
     self.assertEqual(actual, sighting, 'Should return unmodified')