def testIsLightOnTime_withSensorIndicatesDayTime_returnsFalse(self): self.astroSensorItem.setState(StringType('MORNING')) zone = Zone('ff', [self.lightWithIlluminance, self.astroSensor]) self.assertFalse(zone.isLightOnTime())
def testIsLightOnTime_withSensorIndicatesEveningTime_returnsTrue(self): self.astroSensorItem.setState(StringType( AstroSensor.LIGHT_ON_TIMES[0])) zone = Zone('ff', [self.lightWithIlluminance, self.astroSensor]) self.assertTrue(zone.isLightOnTime())
def testIsLightOnTime_noSensor_returnsNone(self): zone = Zone('ff', [self.lightWithIlluminance, self.motionSensor]) self.assertEqual(None, zone.isLightOnTime())