mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-08 08:30:47 -09:00
package/apscheduler: new runtime test
Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu> Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
committed by
Julien Olivain
parent
26900bc6c9
commit
6bcc6aba29
15
support/testing/tests/package/sample_python_apscheduler.py
Normal file
15
support/testing/tests/package/sample_python_apscheduler.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from queue import Queue
|
||||
from apscheduler.schedulers.background import BackgroundScheduler
|
||||
|
||||
queue = Queue()
|
||||
|
||||
|
||||
def work():
|
||||
queue.put("Ping!")
|
||||
|
||||
|
||||
scheduler = BackgroundScheduler()
|
||||
scheduler.add_job(work, "interval", seconds=1)
|
||||
scheduler.start()
|
||||
result = queue.get(timeout=3)
|
||||
assert result == "Ping!"
|
||||
Reference in New Issue
Block a user