Beispiel #1
0
 def test400_910_ShouldHandleInvalidObservation(self):
     input = {
         'op': 'adjust',
         'observation': '0d0.0'
     }
     expected = copy.deepcopy(input)
     expected['error'] = 'observation is invalid'
     actual = adjust.adjust(input)
     self.assertEqual(actual, expected)
Beispiel #2
0
 def test400_030_ShouldAdjustNominalDefaultValues(self):
     input = {
         'observation': '42d0.0',
         'op': 'adjust'
     }
     expected = copy.deepcopy(input)
     expected['altitude'] = '41d59.0'
     actual = adjust.adjust(input)
     self.assertEqual(actual, expected)
Beispiel #3
0
 def test400_960_ShouldHandleAltitudeGivenInInput(self):
     input = {
         'op': 'adjust',
         'observation': '45d11.2',
         'altitude': '5d11.2',
     }
     expected = copy.deepcopy(input)
     expected['error'] = 'altitude cannot be given in input'
     actual = adjust.adjust(input)
     self.assertEqual(actual, expected)
Beispiel #4
0
 def test400_950_ShouldHandleInvalidHorizon(self):
     input = {
         'op': 'adjust',
         'observation': '45d11.2',
         'horizon': 'natura'
     }
     expected = copy.deepcopy(input)
     expected['error'] = 'horizon is invalid'
     actual = adjust.adjust(input)
     self.assertEqual(actual, expected)
Beispiel #5
0
 def test400_940_ShouldHandleInvalidTemperature(self):
     input = {
         'op': 'adjust',
         'observation': '45d11.2',
         'temperature': '121'
     }
     expected = copy.deepcopy(input)
     expected['error'] = 'temperature is invalid'
     actual = adjust.adjust(input)
     self.assertEqual(actual, expected)
Beispiel #6
0
 def test400_930_ShouldHandleInvalidPressure(self):
     input = {
         'op': 'adjust',
         'observation': '45d11.2',
         'pressure': '99'
     }
     expected = copy.deepcopy(input)
     expected['error'] = 'pressure is invalid'
     actual = adjust.adjust(input)
     self.assertEqual(actual, expected)
Beispiel #7
0
 def test400_920_ShouldHandleInvalidHeight(self):
     input = {
         'op': 'adjust',
         'observation': '45d11.2',
         'height': '-10.0'
     }
     expected = copy.deepcopy(input)
     expected['error'] = 'height is invalid'
     actual = adjust.adjust(input)
     self.assertEqual(actual, expected)
Beispiel #8
0
 def test400_010_ShouldAdjustNominal(self):
     input = {
         'observation': '30d1.5',
         'height': '19.0',
         'pressure': '1000',
         'horizon':  'artificial',
         'op': 'adjust',
         'temperature': '85'
     }
     expected = copy.deepcopy(input)
     expected['altitude'] = '29d59.9'
     actual = adjust.adjust(input)
     self.assertEqual(actual, expected)
Beispiel #9
0
 def test400_020_ShouldAdjustNominalHandleExtraKey(self):
     input = {
         'observation': '45d15.2',
         'height': '6',
         'pressure': '1010',
         'horizon':  'natural',
         'op': 'adjust',
         'temperature': '71',
         'extra': 'ignoreme'
     }
     expected = copy.deepcopy(input)
     expected['altitude'] = '45d11.9'
     actual = adjust.adjust(input)
     self.assertEqual(actual, expected)