def testTriggerDelayLess(self, get_param, ns): tm = TriggerMonitor() tm.load_config() tm.on_change_only = True tm.trigger_delay = 100 tm.variable_changed("test", "var1") t1 = tm.prev_change["var1"] tm.variable_changed("test2", "var1") assert tm.prev_values["var1"] == "test2" assert tm.prev_change["var1"] == t1
def testNoPrevChange(self, get_param, ns): tm = TriggerMonitor() tm.load_config() tm.on_change_only = True tm.trigger_delay = 0 tm.variable_changed("test", "var1") tm.variable_changed("test", "var2") t1 = tm.prev_change["var1"] t2 = tm.prev_change["var2"] tm.variable_changed("test2", "var1") tm.variable_changed("test", "var2") assert tm.prev_values["var1"] == "test2" assert tm.prev_values["var2"] == "test" assert tm.prev_change["var2"] == t2 assert tm.prev_change["var1"] != t1