projects
/
python_utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
19ca9f7
)
Add doctest to misc_utils.
author
Scott Gasch
<
[email protected]
>
Sat, 5 Feb 2022 22:09:59 +0000
(14:09 -0800)
committer
Scott Gasch
<
[email protected]
>
Sat, 5 Feb 2022 22:09:59 +0000
(14:09 -0800)
misc_utils.py
patch
|
blob
|
history
diff --git
a/misc_utils.py
b/misc_utils.py
index fc1d5c28e86c5201ec25a800c93f4ce749578402..4979a3c65bcb377b813b18868962297f80b0bd1d 100644
(file)
--- a/
misc_utils.py
+++ b/
misc_utils.py
@@
-4,5
+4,15
@@
import os
def is_running_as_root() -> bool:
- """Returns True if running as root."""
+ """Returns True if running as root.
+
+ >>> is_running_as_root()
+ False
+ """
return os.geteuid() == 0
+
+
+if __name__ == '__main__':
+ import doctest
+
+ doctest.testmod()