projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add a simple test for waitable presence.
[python_utils.git]
/
misc_utils.py
diff --git
a/misc_utils.py
b/misc_utils.py
index a4757bd3a0f6b37a1111b320ec907c9aea5f6592..4979a3c65bcb377b813b18868962297f80b0bd1d 100644
(file)
--- a/
misc_utils.py
+++ b/
misc_utils.py
@@
-2,5
+2,17
@@
import os
+
def is_running_as_root() -> bool:
+ """Returns True if running as root.
+
+ >>> is_running_as_root()
+ False
+ """
return os.geteuid() == 0
+
+
+if __name__ == '__main__':
+ import doctest
+
+ doctest.testmod()