From d2376b4dd7a8bba0dfc878578086faeab83c6f5b Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Sat, 5 Feb 2022 14:09:59 -0800 Subject: [PATCH] Add doctest to misc_utils. --- misc_utils.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/misc_utils.py b/misc_utils.py index fc1d5c2..4979a3c 100644 --- 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() -- 2.47.1