From: Scott Gasch Date: Sat, 5 Feb 2022 22:09:59 +0000 (-0800) Subject: Add doctest to misc_utils. X-Git-Url: https://wannabe.guru.org/gitweb/?a=commitdiff_plain;h=d2376b4dd7a8bba0dfc878578086faeab83c6f5b;p=python_utils.git Add doctest to misc_utils. --- 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()