You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pyentrypoint/tests/runner_test.py

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