From e77fb4d6b952a69b692155c20f4ff248266944a1 Mon Sep 17 00:00:00 2001 From: Aaron Bentley Date: Tue, 17 May 2005 19:58:30 +0000 Subject: Added tests for missing $EDITOR Modified bug reports: ecc: no tests for missing $EDITOR status: open -> closed --- libbe/utility.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'libbe') diff --git a/libbe/utility.py b/libbe/utility.py index a31d5d8..3d805cd 100644 --- a/libbe/utility.py +++ b/libbe/utility.py @@ -99,7 +99,17 @@ class CantFindEditor(Exception): Exception.__init__(self, "Can't find editor to get string from") def editor_string(): - """Invokes the editor, and returns the user_produced text as a string""" + + """Invokes the editor, and returns the user_produced text as a string + + >>> del os.environ["EDITOR"] + >>> editor_string() + Traceback (most recent call last): + CantFindEditor: Can't find editor to get string from + >>> os.environ["EDITOR"] = "echo bar > " + >>> editor_string() + 'bar\\n' + """ try: editor = os.environ["EDITOR"] except KeyError: -- cgit