mirror of
https://github.com/naruxde/revpimodio2.git
synced 2026-03-31 23:18:04 +02:00
test: Events and signals
This commit is contained in:
29
tests/events_and_signals/test_signals.py
Normal file
29
tests/events_and_signals/test_signals.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Test signals."""
|
||||
__author__ = "Sven Sager"
|
||||
__copyright__ = "Copyright (C) 2024 Sven Sager"
|
||||
__license__ = "GPLv2"
|
||||
|
||||
from os.path import dirname
|
||||
|
||||
from tests import TestRevPiModIO
|
||||
from tests.helper import ExitSignal
|
||||
|
||||
|
||||
class TestSignals(TestRevPiModIO):
|
||||
data_dir = dirname(__file__)
|
||||
|
||||
def test_handle_signal_end(self):
|
||||
rpi = self.modio(autorefresh=True)
|
||||
rpi.io.v_druck.value = True
|
||||
|
||||
def ende():
|
||||
rpi.io.v_druck.value = False
|
||||
|
||||
rpi.handlesignalend(ende)
|
||||
|
||||
th_ende = ExitSignal(1)
|
||||
th_ende.start()
|
||||
rpi.mainloop()
|
||||
|
||||
self.assertFalse(rpi.io.v_druck.value)
|
||||
Reference in New Issue
Block a user