test: Events and signals

This commit is contained in:
2024-10-29 13:56:29 +01:00
parent 32d113540c
commit 1de230c1e2
4 changed files with 178 additions and 0 deletions

View File

@@ -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."""