def test430_920_ShouldHandleTooHot(self): input = {'temperature': '121'} with self.assertRaises(ValueError): adjust.extractTemperature(input) self.assertEqual(input['error'], 'temperature is invalid')
def test430_920_ShouldHandleNonIntegerString(self): input = {'temperature': '20.0'} with self.assertRaises(ValueError): adjust.extractTemperature(input) self.assertEqual(input['error'], 'temperature is invalid')
def test430_040_ShouldExtractDefaultValue(self): actual = adjust.extractTemperature({}) self.assertEqual(actual, 72)
def test430_030_ShouldExtractHighValue(self): actual = adjust.extractTemperature({'temperature': '120'}) self.assertEqual(actual, 120)
def test430_020_ShouldExtractLowValue(self): actual = adjust.extractTemperature({'temperature': '-20'}) self.assertEqual(actual, -20)
def test430_010_ShouldExtractNominalValue(self): actual = adjust.extractTemperature({'temperature': '70'}) self.assertEqual(actual, 70)