Revision: 3442
Author: pekka.klarck
Date: Mon May 24 13:23:25 2010
Log: 1) Updated test after kw names not being normalized, 2) Enhanceed test
for overriding stdlib keywords with own keywords slightly
http://code.google.com/p/robotframework/source/detail?r=3442
Modified:
/trunk/atest/robot/keywords/keyword_namespaces.txt
/trunk/atest/testdata/keywords/keyword_namespaces.txt
/trunk/atest/testdata/keywords/resources/MyLibrary1.py
=======================================
--- /trunk/atest/robot/keywords/keyword_namespaces.txt Tue Apr 13 03:19:23
2010
+++ /trunk/atest/robot/keywords/keyword_namespaces.txt Mon May 24 13:23:25
2010
@@ -24,12 +24,12 @@
Keyword From User Library Overrides Keywords From Standard Library
Check Test Case Keyword From User Library Overrides Keywords From
Standard Library
- Check Stderr Contains [ WARN ] Keyword 'Comment' found both from a
user created test library 'MyLibrary1' and Robot Framework standard
library 'BuiltIn'. The user created keyword is used. To select explicitly,
and to get rid of this warning, use full format i.e.
either 'MyLibrary1.Comment' or 'BuiltIn.Comment'.
- Check Stderr Contains [ WARN ] Keyword 'Copy Directory' found both
from a user created test library 'MyLibrary1' and Robot Framework standard
library 'OperatingSystem'. The user created keyword is used. To select
explicitly, and to get rid of this warning, use full format i.e.
either 'MyLibrary1.Copy Directory' or 'OperatingSystem.Copy Directory'.
+ Check Log Message ${ERRORS.msgs[0]} Keyword 'Comment' found both
from a user created test library 'MyLibrary1' and Robot Framework standard
library 'BuiltIn'. The user created keyword is used. To select explicitly,
and to get rid of this warning, use full format i.e.
either 'MyLibrary1.Comment' or 'BuiltIn.Comment'. WARN
+ Check Log Message ${ERRORS.msgs[1]} Keyword 'Copy Directory' found
both from a user created test library 'MyLibrary1' and Robot Framework
standard library 'OperatingSystem'. The user created keyword is used. To
select explicitly, and to get rid of this warning, use full format i.e.
either 'MyLibrary1.Copy Directory' or 'OperatingSystem.Copy Directory'.
WARN
Keyword From User Library Overrides Keywords From Standard Library Even
When Std Lib Imported With Different Name
Check Test Case Keyword From User Library Overrides Keywords From
Standard Library Even When Std lib imported with Different Name
- Check Stderr Contains [ WARN ] Keyword 'Open Connection' found both
from a user created test library 'MyLibrary1' and Robot Framework standard
library 'Telnet'. The user created keyword is used. To select explicitly,
and to get rid of this warning, use full format i.e.
either 'MyLibrary1.Open Connection' or 'StdLibWithCustomName.Open
Connection'.
+ Check Log Message ${ERRORS.msgs[2]} Keyword 'Replace String' found
both from a user created test library 'MyLibrary1' and Robot Framework
standard library 'String'. The user created keyword is used. To select
explicitly, and to get rid of this warning, use full format i.e.
either 'MyLibrary1.Replace String' or 'Std Lib With Custom Name.Replace
String'. WARN
No Warning When User Library Keyword Is Registered As RunKeyword Variant
And It Has Same Name As Std Keyword
Check Test Case No Warning when User Library Keyword Is Registered As
RunKeyword Variant And It Has Same Name As Std Keyword
=======================================
--- /trunk/atest/testdata/keywords/keyword_namespaces.txt Tue Apr 13
03:19:23 2010
+++ /trunk/atest/testdata/keywords/keyword_namespaces.txt Mon May 24
13:23:25 2010
@@ -4,7 +4,7 @@
Library resources/MyLibrary1.py
Library resources/MyLibrary2.py
Library OperatingSystem
-Library Telnet WITH NAME Std Lib With Custom Name
+Library String WITH NAME Std Lib With Custom Name
*** Test Cases ***
Keywords With Unique Name Are Ok
@@ -52,7 +52,12 @@
Copy Directory
Keyword From User Library Overrides Keywords From Standard Library Even
When Std Lib Imported With Different Name
- Open Connection
+ ${ret} = Replace String
+ Should Be Equal ${ret} I replace nothing!
+ ${ret} = MyLibrary1.Replace String
+ Should Be Equal ${ret} I replace nothing!
+ ${ret} = Std Lib With Custom Name.Replace String I replace this!
this that
+ Should Be Equal ${ret} I replace that!
No Warning When User Library Keyword Is Registered As RunKeyword Variant
And It Has Same Name As Std Keyword
Run Keyword If ${TRUE} Log Hello
=======================================
--- /trunk/atest/testdata/keywords/resources/MyLibrary1.py Tue Apr 13
03:19:23 2010
+++ /trunk/atest/testdata/keywords/resources/MyLibrary1.py Mon May 24
13:23:25 2010
@@ -27,5 +27,6 @@
def no_operation(self):
print "Overrides keyword from BuiltIn library"
- def open_connection(self):
- print "Overrides keyword from Telnet library"
+ def replace_string(self):
+ print "Overrides keyword from String library"
+ return "I replace nothing!"