def test200_111_Error_HeightLowboundViolation(self): result = adjust.adjust({ 'op': 'adjust', 'observation': '0d0.0', 'height': '-1' }) self.assert_(result['error'] == dispatch.ERROR_INVALID_HEIGHT)
def test200_132_Error_TemperatureHighboundViolation(self): result = adjust.adjust({ 'op': 'adjust', 'observation': '0d0.0', 'temperature': '121' }) self.assertEqual(result['error'], dispatch.ERROR_INVALID_TEMPERATURE)
def test200_122_Error_PressureHighboundViolation(self): result = adjust.adjust({ 'op': 'adjust', 'observation': '0d0.0', 'pressure': '1101' }) self.assert_(result['error'] == dispatch.ERROR_INVALID_PRESSURE)
def test200_003_Success_ObsHighbound(self): result = adjust.adjust({'op': 'adjust', 'observation': '89d59.9'}) if ('error' in result): self.assertNotEquals(result['error'], dispatch.ERROR_INVALID_OBSERVATION) else: self.assert_(True)
def test200_002_Success_ObsNom(self): result = adjust.adjust({'op': 'adjust', 'observation': '45d30.0'}) if ('error' in result): self.assertNotEquals(result['error'], dispatch.ERROR_INVALID_OBSERVATION) else: self.assert_(True)
def test200_013_Success_HeightNotGiven(self): result = adjust.adjust({'op': 'adjust', 'observation': '0d0.0'}) if ('error' in result): self.assert_(result['error'] != dispatch.ERROR_INVALID_HEIGHT) elif ('height' in result): self.assert_(result['height'] == '0') else: self.assert_(False)
def test200_141_Error_HorizonInvalidInput(self): result = adjust.adjust({ 'op': 'adjust', 'observation': '0d0.0', 'horizon': 'unknown' }) self.assert_('error' in result) self.assertEqual(result['error'], dispatch.ERROR_INVALID_HORIZON)
def test200_034_Success_TempNotGiven(self): result = adjust.adjust({'op': 'adjust', 'observation': '0d0.0'}) if ('error' in result): self.assertNotEqual(result['error'], dispatch.ERROR_INVALID_TEMPERATURE) if ('temperature' in result): self.assertEqual(result['temperature'], '72') else: self.assert_(False)
def test200_012_Success_HeightNom(self): result = adjust.adjust({ 'op': 'adjust', 'observation': '0d0.0', 'height': '300' }) if ('error' in result): self.assert_(result['error'] != dispatch.ERROR_INVALID_HEIGHT) else: self.assert_(True)
def test200_021_Success_PressureHighbound(self): result = adjust.adjust({ 'op': 'adjust', 'observation': '0d0.0', 'pressure': '1100' }) if ('error' in result): self.assert_(result['error'] != dispatch.ERROR_INVALID_PRESSURE) else: self.assert_(True)
def test200_051_Success_ObsLowboundCalc(self): result = adjust.adjust({ 'op': 'adjust', 'observation': '0d0.0', 'height': '300', 'temperature': '60', 'pressure': '600', 'horizon': 'artificial' }) self.assert_('altitude' in result) self.assertEqual(result['altitude'], '-0d2.7')
def test200_033_Success_TempHighbound(self): result = adjust.adjust({ 'op': 'adjust', 'observation': '0d0.0', 'temperature': '120' }) if ('error' in result): self.assertNotEqual(result['error'], dispatch.ERROR_INVALID_TEMPERATURE) else: self.assert_(True)
def test200_056_Success_NaturalHorizonCalc(self): result = adjust.adjust({ 'op': 'adjust', 'observation': '45d30.0', 'height': '300', 'temperature': '60', 'pressure': '600', 'horizon': 'natural' }) self.assert_('altitude' in result) self.assertEqual(result['altitude'], '45d10.5')
def test200_055_Success_PressureHighboundCalc(self): result = adjust.adjust({ 'op': 'adjust', 'observation': '45d30.0', 'height': '300', 'temperature': '60', 'pressure': '1100', 'horizon': 'artificial' }) self.assert_('altitude' in result) self.assertEqual(result['altitude'], '45d25.0')
def test200_053_Success_HeightLowboundCalc(self): result = adjust.adjust({ 'op': 'adjust', 'observation': '45d30.0', 'height': '0', 'temperature': '60', 'pressure': '600', 'horizon': 'natural' }) self.assert_('altitude' in result) self.assertEqual(result['altitude'], '45d27.3')
def test200_044_Success_HorizonNaturalCaseInsensitive(self): result = adjust.adjust({ 'op': 'adjust', 'observation': '0d0.0', 'horizon': 'NatuRAL' }) if ('error' in result): self.assertNotEqual(result['error'], dispatch.ERROR_INVALID_HORIZON) else: self.assert_(True)
def test200_041_Success_HorizonArtificialLowercase(self): result = adjust.adjust({ 'op': 'adjust', 'observation': '0d0.0', 'horizon': 'artificial' }) if ('error' in result): self.assertNotEqual(result['error'], dispatch.ERROR_INVALID_HORIZON) else: self.assert_(True)
def test200_103_Error_ObsNotIncluded(self): result = adjust.adjust({'op': 'adjust'}) self.assert_(result['error'] == dispatch.ERROR_MANDATORY_INFO_MISSING)
def test200_102_Error_ObsHighboundViolation(self): result = adjust.adjust({'op': 'adjust', 'observation': '90d60.0'}) self.assert_(result['error'] == dispatch.ERROR_INVALID_OBSERVATION)
def test200_101_Error_ObsLowboundViolation(self): result = adjust.adjust({'op': 'adjust', 'observation': '-1d-1.1'}) self.assert_(result['error'] == dispatch.ERROR_INVALID_OBSERVATION)
def test200_045_Success_HorizonNotGiven(self): result = adjust.adjust({'op': 'adjust', 'observation': '0d0.0'}) self.assert_('horizon' in result) self.assertEqual(result['horizon'], 'natural')
def test200_021_Success_PressureNotGiven(self): result = adjust.adjust({'op': 'adjust', 'observation': '0d0.0'}) if ('pressure' in result): self.assert_(result['pressure'] == '1010') else: self.assert_(False)