Revision: e65f2413d57b
Branch:   default
Author:   Tatu Kairi <[email protected]>
Date:     Fri May 24 02:41:12 2013
Log:      Enhanced Pass Execution-keyword: no empty strings as message

Update issue 174

Pass Execution keyword raises error when used with empty string as message
http://code.google.com/p/robotframework/source/detail?r=e65f2413d57b

Modified:
 /atest/robot/running/pass_execution.txt
 /atest/testdata/running/pass_execution.txt
 /src/robot/libraries/BuiltIn.py

=======================================
--- /atest/robot/running/pass_execution.txt     Thu May 23 05:33:43 2013
+++ /atest/robot/running/pass_execution.txt     Fri May 24 02:41:12 2013
@@ -18,6 +18,12 @@
 With HTML message
     ${tc}=    Check Test Tags    ${TESTNAME}    force1    force2
Check Log Message ${tc.kws[0].msgs[0]} ${PREFIX}<b>message</b> HTML
+
+With empty string as a message
+    Check Test Case    ${TESTNAME}
+
+With only whitespace as a message
+    Check Test Case    ${TESTNAME}

 Remove one tag
     ${tc}=    Check Test Tags    ${TESTNAME}    force2
=======================================
--- /atest/testdata/running/pass_execution.txt  Thu May 23 05:33:43 2013
+++ /atest/testdata/running/pass_execution.txt  Fri May 24 02:41:12 2013
@@ -11,7 +11,7 @@

 With message
     [Documentation]    PASS exception message
-    Pass Execution    exception message
+    Pass Execution    ${EMPTY}exception message ${SPACE}
     Fail    should not go here

 With HTML message
@@ -19,6 +19,16 @@
     Pass Execution    *HTML*<b>message</b>
     Fail    this should not execute

+With empty string as a message
+    [Documentation]    FAIL Message cannot be empty.
+    Pass Execution    ${EMPTY}
+    Fail    this should not execute
+
+With only whitespace as a message
+    [Documentation]    FAIL Message cannot be empty.
+    Pass Execution    ${SPACE} ${SPACE}
+    Fail    this should not execute
+
 Remove one tag
     [Documentation]    PASS message
     Pass Execution    message    -force1
@@ -176,3 +186,4 @@
     Run Keyword And Continue On Failure    Fail    ${msg}
     Pass Execution    message
     Fail    Should not go here
+
=======================================
--- /src/robot/libraries/BuiltIn.py     Thu May 23 02:10:25 2013
+++ /src/robot/libraries/BuiltIn.py     Fri May 24 02:41:12 2013
@@ -812,6 +812,9 @@
         return msg

     def pass_execution(self, message, *tags):
+        message = message.strip()
+        if not message:
+            raise RuntimeError('Message cannot be empty.')
         self._set_and_remove_tags(tags)
log_message, level = self._get_logged_test_message_and_level(message)
         self.log('Execution passed with message:\n%s' % log_message, level)

--

--- You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to