mirror of
https://github.com/naruxde/revpimodio2.git
synced 2026-09-30 23:04:29 +02:00
test: Events and signals
This commit is contained in:
1 parent
32d113540c
commit
1de230c1e2
4 files changed
+178
No files matched your search
@@ -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