Skip to content

Commit 54f59e3

Browse files
committed
Parse keywords
1 parent 2f84176 commit 54f59e3

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/robotlibcore.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ def parse_plugins(self, plugins: str) -> typing.List:
305305
imported_plugins.append(plugin)
306306
return imported_plugins
307307

308-
def get_plugin_keyword(self, plugins: typing.List):
309-
pass
308+
def get_plugin_keywords(self, plugins: typing.List):
309+
return DynamicCore(plugins).get_keyword_names()
310310

311311
def _string_to_modules(self, modules):
312312
parsed_modules = []

utest/helpers/my_plugin_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def base(self):
2323
class TestClassWithBase(LibraryBase):
2424

2525
@keyword
26-
def another_keywor(self) -> int:
26+
def another_keyword(self) -> int:
2727
return 2 * 2
2828

2929
def normal_method(self):

utest/test_plugin_api.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,11 @@ def test_parse_plugins_with_base():
5656
with pytest.raises(PluginError) as excinfo:
5757
parser.parse_plugins("my_plugin_test.TestClass")
5858
assert "Plugin does not inherit <class 'my_plugin_test.LibraryBase'>" in str(excinfo.value)
59+
60+
61+
def test_plugin_keywords(plugin_parser):
62+
plugins = plugin_parser.parse_plugins("my_plugin_test.TestClass,my_plugin_test.TestClassWithBase")
63+
keywords = plugin_parser.get_plugin_keywords(plugins)
64+
assert len(keywords) == 2
65+
assert keywords[0] == "another_keyword"
66+
assert keywords[1] == "new_keyword"

0 commit comments

Comments
 (0)