Exemple #1
0
 def test440_920_ShouldHandleTooHigh(self):
     input = {'pressure': '1101'}
     with self.assertRaises(ValueError):
         adjust.extractPressure(input)
     self.assertEqual(input['error'], 'pressure is invalid')
Exemple #2
0
 def test440_920_ShouldHandleNonIntegerString(self):
     input = {'pressure': '1000.0'}
     with self.assertRaises(ValueError):
         adjust.extractPressure(input)
     self.assertEqual(input['error'], 'pressure is invalid')
Exemple #3
0
 def test440_030_ShouldExtractHighValue(self):
     actual = adjust.extractPressure({'pressure': '1100'})
     self.assertEqual(actual, 1100)
Exemple #4
0
 def test440_040_ShouldExtractDefaultValue(self):
     actual = adjust.extractPressure({})
     self.assertEqual(actual, 1010)
Exemple #5
0
 def test440_010_ShouldExtractNominalValue(self):
     actual = adjust.extractPressure({'pressure': '1000'})
     self.assertEqual(actual, 1000)