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:
@@ -27,6 +27,19 @@ class ChangeThread(Thread):
|
||||
self.revpi.io[self.ioname].value = self.iovalue
|
||||
|
||||
|
||||
class ExitSignal(Thread):
|
||||
"""Call SIGINT after given time."""
|
||||
|
||||
def __init__(self, time):
|
||||
"""Signal SIGINT after given time."""
|
||||
super().__init__()
|
||||
self.time = time
|
||||
|
||||
def run(self):
|
||||
sleep(self.time)
|
||||
os.kill(os.getpid(), SIGINT)
|
||||
|
||||
|
||||
class ExitThread(Thread):
|
||||
"""Call .exit() of ModIO after given time."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user