Пример #1
0
 def test_get_humidity_false(self):
     self.assertEqual(smart_home_sensors.get_humidity(None),
                      "Luftfuktighet: 30%")
Пример #2
0
 def test_get_humidity_low(self, mock_random):
     mock_random.return_value = 35
     self.assertEqual(smart_home_sensors.get_humidity(1),
                      "Luftfuktighet: 35%")
Пример #3
0
 def test_get_humidity_high(self, mock_random):
     mock_random.return_value = 37
     self.assertEqual(smart_home_sensors.get_humidity(23),
                      "Luftfuktighet: 37%")