2
0
mirror of https://github.com/cmehay/pyentrypoint synced 2024-10-30 15:21:11 +00:00
pyentrypoint/tests/runner_test.py
Christophe Mehay 1770ac87f6 Update to v0.6.0
- Add new `commands` setting to handle multiple commands
- Deprecate `command` and `subcommands`
- Drop support for python 2
- Handle dependancy and build with Poetry
2020-05-10 23:32:31 +02:00

23 lines
543 B
Python

"Tests for runner"
import os
from multiprocessing import Process
from pyentrypoint import Entrypoint
def test_runner():
run = [
(Process(target=Entrypoint(
conf='configs/runner.yml',
args=['sleep', '5']).launch),
'/tmp/runner_test', 0, 0),
]
for proc, test, uid, gid in run:
proc.start()
proc.join()
with open(test, 'r') as f:
assert f.readline().startswith('OK')
assert os.stat(test).st_uid == uid
assert os.stat(test).st_gid == gid