Bläddra i källkod

Tests: update cover tests for new logic

Garage door, QS01 curtain, simple blind cannot reliably determine
opening and closing states, so update the tests for this.

Issue #2099
Jason Rumney 1 år sedan
förälder
incheckning
4d2a303afc

+ 2 - 2
tests/devices/test_garage_door_opener.py

@@ -41,14 +41,14 @@ class TestSimpleGarageOpener(TuyaDeviceTestCase):
         self.dps[SWITCH_DPS] = True
         self.assertFalse(self.subject.is_opening)
         self.dps[OPEN_DPS] = False
-        self.assertTrue(self.subject.is_opening)
+        self.assertFalse(self.subject.is_opening)
 
     def test_is_closing(self):
         self.dps[SWITCH_DPS] = False
         self.dps[OPEN_DPS] = False
         self.assertFalse(self.subject.is_closing)
         self.dps[OPEN_DPS] = True
-        self.assertTrue(self.subject.is_closing)
+        self.assertFalse(self.subject.is_closing)
         self.dps[SWITCH_DPS] = True
         self.assertFalse(self.subject.is_closing)
         self.dps[OPEN_DPS] = False

+ 6 - 6
tests/devices/test_qs_c01_curtain.py

@@ -61,22 +61,22 @@ class TestQSC01Curtains(BasicNumberTests, BasicSelectTests, TuyaDeviceTestCase):
         self.dps[POSITION_DPS] = 100
         self.assertFalse(self.subject.is_opening)
         self.dps[POSITION_DPS] = 50
-        self.assertTrue(self.subject.is_opening)
+        self.assertIsNone(self.subject.is_opening)
         self.dps[COMMAND_DPS] = "close"
-        self.assertFalse(self.subject.is_opening)
+        self.assertIsNone(self.subject.is_opening)
         self.dps[COMMAND_DPS] = "stop"
-        self.assertFalse(self.subject.is_opening)
+        self.assertIsNone(self.subject.is_opening)
 
     def test_is_closing(self):
         self.dps[COMMAND_DPS] = "close"
         self.dps[POSITION_DPS] = 0
         self.assertFalse(self.subject.is_closing)
         self.dps[POSITION_DPS] = 50
-        self.assertTrue(self.subject.is_closing)
+        self.assertIsNone(self.subject.is_closing)
         self.dps[COMMAND_DPS] = "open"
-        self.assertFalse(self.subject.is_closing)
+        self.assertIsNone(self.subject.is_closing)
         self.dps[COMMAND_DPS] = "stop"
-        self.assertFalse(self.subject.is_closing)
+        self.assertIsNone(self.subject.is_closing)
 
     def test_is_closed(self):
         self.dps[COMMAND_DPS] = "close"

+ 7 - 7
tests/devices/test_simple_blinds.py

@@ -42,22 +42,22 @@ class TestSimpleBlinds(TuyaDeviceTestCase):
         self.dps[POSITION_DPS] = 0
         self.assertFalse(self.subject.is_opening)
         self.dps[POSITION_DPS] = 50
-        self.assertTrue(self.subject.is_opening)
+        self.assertIsNone(self.subject.is_opening)
         self.dps[COMMAND_DPS] = "close"
-        self.assertFalse(self.subject.is_opening)
+        self.assertIsNone(self.subject.is_opening)
         self.dps[COMMAND_DPS] = "stop"
-        self.assertFalse(self.subject.is_opening)
+        self.assertIsNone(self.subject.is_opening)
 
     def test_is_closing(self):
         self.dps[COMMAND_DPS] = "close"
         self.dps[POSITION_DPS] = 100
         self.assertFalse(self.subject.is_closing)
         self.dps[POSITION_DPS] = 50
-        self.assertTrue(self.subject.is_closing)
+        self.assertIsNone(self.subject.is_closing)
         self.dps[COMMAND_DPS] = "open"
-        self.assertFalse(self.subject.is_closing)
+        self.assertIsNone(self.subject.is_closing)
         self.dps[COMMAND_DPS] = "stop"
-        self.assertFalse(self.subject.is_closing)
+        self.assertIsNone(self.subject.is_closing)
 
     def test_is_closed(self):
         self.dps[COMMAND_DPS] = "close"
@@ -66,7 +66,7 @@ class TestSimpleBlinds(TuyaDeviceTestCase):
         self.dps[POSITION_DPS] = 100
         self.assertTrue(self.subject.is_closed)
         self.dps[COMMAND_DPS] = "stop"
-        self.assertIsNone(self.subject.is_closed)
+        self.assertTrue(self.subject.is_closed)
 
     async def test_open_cover(self):
         async with assert_device_properties_set(