diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-09-05 14:18:32 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-09-05 14:18:32 +0200 |
commit | 0cf0cf7e42b62350fe6c8d6c2cbfb4e9c48a6f75 (patch) | |
tree | 4ecb7c70b8929ac9d582297fa85b816e94f2688c | |
parent | 2e115f3c4f6f96a2fae0ef011def64ab8b0a11ca (diff) | |
download | python-systemd-0cf0cf7e42b62350fe6c8d6c2cbfb4e9c48a6f75.tar.gz |
tests: daemon.booted
-rw-r--r-- | systemd/test/test_daemon.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/systemd/test/test_daemon.py b/systemd/test/test_daemon.py index 96c5717..c048929 100644 --- a/systemd/test/test_daemon.py +++ b/systemd/test/test_daemon.py @@ -1,10 +1,18 @@ import sys import os import posix -from systemd.daemon import _is_fifo, is_fifo, listen_fds +from systemd.daemon import _is_fifo, is_fifo, listen_fds, booted import pytest +def test_booted(): + if os.path.exists('/run/systemd'): + # assume we are running under systemd + assert booted() + else: + # don't assume anything + assert booted() in {False, True} + def test__is_fifo(tmpdir): path = tmpdir.join('test.fifo').strpath posix.mkfifo(path) |