Explorar o código

Himox H06: add test for mapped speed being mapped to integer

When mapping specifies an integer without quotes, we expect the result of
the mapping to be an integer, even if the dps type was string.

User reports that percentage is not working correctly when they map from
string values, but it is not what was expected.

PR #2586
Jason Rumney hai 1 ano
pai
achega
f4b0aa62c5
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      tests/devices/test_himox_h06_purifier.py

+ 1 - 0
tests/devices/test_himox_h06_purifier.py

@@ -103,6 +103,7 @@ class TestHimoxH06Purifier(
     def test_speed(self):
         self.dps[SPEED_DPS] = "low"
         self.assertEqual(self.subject.percentage, 33)
+        self.assertEqual(type(self.subject.percentage), int)
 
     def test_speed_step(self):
         self.assertAlmostEqual(self.subject.percentage_step, 33, 0)