test(root_daemon): break out startup

This commit is contained in:
Houkime 2024-12-12 11:39:07 +00:00
parent 76d83c41cf
commit 743fb8a542

View file

@ -48,7 +48,7 @@ def test_init():
assert sock is not None
def test_send_command():
def start_root_demon():
root_daemon_file = selfprivacy_api.root_daemon.__file__
# this is a prototype of how we need to run it`
proc = subprocess.Popen(args=["python", root_daemon_file], shell=False)
@ -58,6 +58,12 @@ def test_send_command():
finished = proc.poll()
assert finished is None
return proc
def test_send_command():
proc = start_root_demon()
answer = call_root_function(["blabla"])
assert answer == "not permitted"
# confirm the loop