Răsfoiți Sursa

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 1 an în urmă
părinte
comite
f4b0aa62c5
1 a modificat fișierele cu 1 adăugiri și 0 ștergeri
  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)