mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-08 00:20:38 -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
@@ -2302,6 +2302,7 @@ F: package/python-typing-inspection/
|
||||
F: package/python-tzlocal/
|
||||
F: package/python-sdbus-modemmanager/
|
||||
F: package/python-waitress/
|
||||
F: support/testing/tests/package/test_python_apscheduler.py
|
||||
F: support/testing/tests/package/test_python_crc.py
|
||||
F: support/testing/tests/package/test_python_django.py
|
||||
F: support/testing/tests/package/test_python_fastapi.py
|
||||
@@ -2311,6 +2312,7 @@ F: support/testing/tests/package/test_python_ruamel_yaml.py
|
||||
F: support/testing/tests/package/test_python_sdbus_modemmanager.py
|
||||
F: support/testing/tests/package/test_python_tzlocal.py
|
||||
F: support/testing/tests/package/test_python_waitress.py
|
||||
F: support/testing/tests/package/sample_python_apscheduler.py
|
||||
F: support/testing/tests/package/sample_python_crc.py
|
||||
F: support/testing/tests/package/sample_python_django.py
|
||||
F: support/testing/tests/package/sample_python_fastapi.py
|
||||
|
||||
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!"
|
||||
12
support/testing/tests/package/test_python_apscheduler.py
Normal file
12
support/testing/tests/package/test_python_apscheduler.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from tests.package.test_python import TestPythonPackageBase
|
||||
|
||||
|
||||
class TestPythonPy3Apscheduler(TestPythonPackageBase):
|
||||
__test__ = True
|
||||
config = TestPythonPackageBase.config + \
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON3=y
|
||||
BR2_PACKAGE_PYTHON_APSCHEDULER=y
|
||||
"""
|
||||
sample_scripts = ["tests/package/sample_python_apscheduler.py"]
|
||||
timeout = 15
|
||||
Reference in New Issue
Block a user