mirror of
https://github.com/cmehay/pyentrypoint
synced 2024-10-30 15:21:11 +00:00
23 lines
543 B
Python
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
|