Added tests for missing $EDITOR
authorAaron Bentley <abentley@panoramicfeedback.com>
Tue, 17 May 2005 19:58:30 +0000 (19:58 +0000)
committerAaron Bentley <abentley@panoramicfeedback.com>
Tue, 17 May 2005 19:58:30 +0000 (19:58 +0000)
Modified bug reports:
 ecc: no tests for missing $EDITOR
status: open -> closed

.be/bugs/ecc91b94-7f3f-44a7-af58-03191d327a7f/values
becommands/comment.py
libbe/utility.py

index bcb0409068a21f97d446e967c7920835681d1cdc..555375b1975c3ec55f943fa37d55d3e5932a63b1 100644 (file)
@@ -15,7 +15,7 @@ severity=minor
 
 
 
-status=open
+status=closed
 
 
 
index 6a7998c5daaba5d37190bd5cbc7fd974d387db18..c53fd87bc18359afa06ba3c35f1851ec9f8aafa4 100644 (file)
@@ -33,6 +33,10 @@ def execute(args):
     True
     >>> comment.in_reply_to is None
     True
+    >>> del os.environ["EDITOR"]
+    >>> execute(["b"])
+    Traceback (most recent call last):
+    UserError: No comment supplied, and EDITOR not specified.
     >>> os.environ["EDITOR"] = "echo 'I like cheese' > "
     >>> execute(["b"])
     >>> dir.get_bug("b").list_comments()[0].body
index a31d5d8e502c68cb8ce4d1f4d8f8935eae7c1e0e..3d805cdf332e7554714442d64a3e3664035b1b2c 100644 (file)
@@ -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: