Ejemplo n.º 1
0
def test_setpoint_lockability():
    """Test the lockability of Setpoint objects."""
    heat_setpt = ScheduleRuleset.from_constant_value(
        'Office Heating', 21, schedule_types.temperature)
    cool_setpt = ScheduleRuleset.from_constant_value(
        'Office Cooling', 24, schedule_types.temperature)
    setpoint = Setpoint('Office Setpoint', heat_setpt, cool_setpt)

    setpoint.heating_setpoint = 20
    setpoint.lock()
    with pytest.raises(AttributeError):
        setpoint.heating_setpoint = 22
    setpoint.unlock()
    setpoint.heating_setpoint = 22
Ejemplo n.º 2
0
def test_setpoint_setability():
    """Test the setting of properties of Setpoint."""
    heat_setpt = ScheduleRuleset.from_constant_value(
        'Office Heating', 21, schedule_types.temperature)
    cool_setpt = ScheduleRuleset.from_constant_value(
        'Office Cooling', 24, schedule_types.temperature)
    setpoint = Setpoint('Office Setpoint', heat_setpt, cool_setpt)

    setpoint.identifier = 'Office Zone Setpoint'
    assert setpoint.identifier == 'Office Zone Setpoint'
    setpoint.heating_setpoint = 20
    assert setpoint.heating_setpoint == 20
    assert setpoint.heating_setback == 20
    setpoint.cooling_setpoint = 26
    assert setpoint.cooling_setpoint == 26
    assert setpoint.cooling_setback == 26
    setpoint.humidifying_setpoint = 30
    assert setpoint.humidifying_setpoint == 30
    assert setpoint.humidifying_setback == 30
    setpoint.dehumidifying_setpoint = 60
    assert setpoint.dehumidifying_setpoint == 60
    assert setpoint.dehumidifying_setback == 60