2 new revisions:

Revision: 28e9ec02b84d
Branch: default
Author: Tatu Kairi <[email protected]>
Date: Fri May 31 04:05:49 2013
Log: BuiltIn-keywords Should Be True et al.: automatically import os- and s...
http://code.google.com/p/robotframework/source/detail?r=28e9ec02b84d

Revision: 9acae23486db
Branch: default
Author: Tatu Kairi <[email protected]>
Date: Fri May 31 04:05:57 2013
Log: Automated merge with https://code.google.com/p/robotframework/
http://code.google.com/p/robotframework/source/detail?r=9acae23486db

==============================================================================
Revision: 28e9ec02b84d
Branch: default
Author: Tatu Kairi <[email protected]>
Date: Fri May 31 04:05:49 2013
Log: BuiltIn-keywords Should Be True et al.: automatically import os- and sys-modules

Update issue 1449

Refactoring done with tests. Documentation missing.
http://code.google.com/p/robotframework/source/detail?r=28e9ec02b84d

Modified:
 /atest/robot/standard_libraries/builtin/verify.txt
 /atest/testdata/standard_libraries/builtin/set_variable_if.txt
 /atest/testdata/standard_libraries/builtin/verify.txt
 /src/robot/libraries/BuiltIn.py

=======================================
--- /atest/robot/standard_libraries/builtin/verify.txt Tue Sep 18 15:34:29 2012 +++ /atest/robot/standard_libraries/builtin/verify.txt Fri May 31 04:05:49 2013
@@ -22,6 +22,9 @@

 Should Be True With Invalid Expression
 Check test case ${TESTNAME}
+
+Should (Not) Be True is evaluated with os- and sys-modules
+ Check test case ${TESTNAME}

 Should Not Be Equal
 ${tc}= Check test case ${TESTNAME}
=======================================
--- /atest/testdata/standard_libraries/builtin/set_variable_if.txt Thu Sep 13 12:42:10 2012 +++ /atest/testdata/standard_libraries/builtin/set_variable_if.txt Fri May 31 04:05:49 2013
@@ -33,7 +33,7 @@
 Should Be Equal ${var} ${None}

 Invalid Expression
- [Documentation] FAIL STARTS: Evaluating condition 'invalid expr' failed: SyntaxError: + [Documentation] FAIL STARTS: Evaluating expression 'invalid expr' failed: SyntaxError:
 Set Variable If invalid expr whatever values

 Fails Without Values 1
=======================================
--- /atest/testdata/standard_libraries/builtin/verify.txt Tue Sep 18 15:10:11 2012 +++ /atest/testdata/standard_libraries/builtin/verify.txt Fri May 31 04:05:49 2013
@@ -21,7 +21,7 @@
 Should Not Be True True My message

 Should Not Be True With Invalid Expression
- [Documentation] FAIL STARTS: Evaluating condition 'this is invalid' failed: NameError: + [Documentation] FAIL STARTS: Evaluating expression 'this is invalid' failed: NameError:
 Should Not Be True this is invalid

 Should Be True
@@ -37,9 +37,15 @@
 Should Be True False My error message

 Should Be True With Invalid Expression
- [Documentation] FAIL STARTS: Evaluating condition '"quotes" != "quote missing' failed: SyntaxError: + [Documentation] FAIL STARTS: Evaluating expression '"quotes" != "quote missing' failed: SyntaxError:
 Should Be True "quotes" != "quote missing

+Should (Not) Be True is evaluated with os- and sys-modules
+ Should Be True os.sep
+ Should Be True sys.platform
+ Should Not Be True 'os.sep' == 'wrong'
+ Should Not Be True 'sys.platform' == 'hurd' # let's see when this starts failing
+
 Should Not Be Equal
 [Documentation] FAIL 1 == 1
 [Template] Should Not Be Equal
=======================================
--- /src/robot/libraries/BuiltIn.py     Thu May 30 23:11:35 2013
+++ /src/robot/libraries/BuiltIn.py     Fri May 31 04:05:49 2013
@@ -12,7 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.

-import os # FIXME: This seems to be used by Evaluate!!!!
 import re
 import time

@@ -2438,11 +2437,7 @@

 def _is_true(self, condition):
 if isinstance(condition, basestring):
- try:
- condition = eval(condition)
- except:
- raise RuntimeError("Evaluating condition '%s' failed: %s"
- % (condition, utils.get_error_message()))
+ condition = self.evaluate(condition, modules='os,sys')
 return bool(condition)



==============================================================================
Revision: 9acae23486db
Branch: default
Author: Tatu Kairi <[email protected]>
Date: Fri May 31 04:05:57 2013
Log: Automated merge with https://code.google.com/p/robotframework/
http://code.google.com/p/robotframework/source/detail?r=9acae23486db



--

--- 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