GeezerVison is showing github.com — When library is using @keyword decorator to give new name for the keyword, then the method can not be called with the method name programmatically · Issue #2 · robotframework/PythonLibCore
When library is using @keyword decorator to give new name for the keyword, then the method can not be called with the method name programmatically #2
Description
Example if I have this code:
from robotlibcore import keyword
from robotlibcore import DynamicCore
class KwClass(object):
@keyword('My Keyword')
def my_kw(self):
print 'My Kw'
class MyLibrary(DynamicCore):
def __init__(self):
DynamicCore.__init__(self, [KwClass()])
if __name__ == '__main__':
x = MyLibrary()
print x.keywords
x.my_kw()
Then I can not call keyword with the method name my_kw and the above code raises:
{'My Keyword': <bound method KwClass.my_kw of <__main__.KwClass object at 0x059728D0>>}
Traceback (most recent call last):
File "foo.py", line 21, in <module>
x.my_kw()
File "D:\workspace\SeleniumLibrary\src\SeleniumLibrary\base\robotlibcore.py", line 80, in __getattr__
.format(type(self).__name__, name))
AttributeError: 'MyLibrary' object has no attribute 'my_kw'
Activity
changed the title
[-]When library is using DynamicCore and use @keyword decorator to give new name for the keyword, then the method can not be called with the method name programmatically [/-] [+]When library is using @keyword decorator to give new name for the keyword, then the method can not be called with the method name programmatically [/+] on Nov 27, 2017
Metadata
Metadata
Development
No branches or pull requestsIssue actions