1
- from helpers import my_plugin_test
2
1
import pytest
2
+ from helpers import my_plugin_test
3
3
from robotlibcore import Module , PluginError , PluginParser
4
4
5
5
@@ -19,17 +19,17 @@ def test_plugins_string_to_modules(plugin_parser):
19
19
result = plugin_parser ._string_to_modules ("path.to.MyLibrary,path.to.OtherLibrary" )
20
20
assert result == [
21
21
Module ("path.to.MyLibrary" , [], {}),
22
- Module ("path.to.OtherLibrary" , [], {})
22
+ Module ("path.to.OtherLibrary" , [], {}),
23
23
]
24
24
result = plugin_parser ._string_to_modules ("path.to.MyLibrary , path.to.OtherLibrary" )
25
25
assert result == [
26
26
Module ("path.to.MyLibrary" , [], {}),
27
- Module ("path.to.OtherLibrary" , [], {})
27
+ Module ("path.to.OtherLibrary" , [], {}),
28
28
]
29
29
result = plugin_parser ._string_to_modules ("path.to.MyLibrary;foo;bar , path.to.OtherLibrary;1" )
30
30
assert result == [
31
31
Module ("path.to.MyLibrary" , ["foo" , "bar" ], {}),
32
- Module ("path.to.OtherLibrary" , ["1" ], {})
32
+ Module ("path.to.OtherLibrary" , ["1" ], {}),
33
33
]
34
34
result = plugin_parser ._string_to_modules ("PluginWithKwArgs.py;kw1=Text1;kw2=Text2" )
35
35
assert result == [
@@ -52,7 +52,7 @@ def test_parse_plugins_as_list(plugin_parser):
52
52
assert len (plugins ) == 1
53
53
assert isinstance (plugins [0 ], my_plugin_test .TestClass )
54
54
plugins = plugin_parser .parse_plugins (
55
- ["helpers.my_plugin_test.TestClass" , "helpers.my_plugin_test.TestClassWithBase" ]
55
+ ["helpers.my_plugin_test.TestClass" , "helpers.my_plugin_test.TestClassWithBase" ],
56
56
)
57
57
assert len (plugins ) == 2
58
58
assert isinstance (plugins [0 ], my_plugin_test .TestClass )
@@ -81,11 +81,11 @@ def test_plugin_python_objects():
81
81
class PythonObject :
82
82
x = 1
83
83
y = 2
84
+
84
85
python_object = PythonObject ()
85
86
parser = PluginParser (my_plugin_test .LibraryBase , [python_object ])
86
87
plugins = parser .parse_plugins ("helpers.my_plugin_test.TestPluginWithPythonArgs;4" )
87
88
assert len (plugins ) == 1
88
89
plugin = plugins [0 ]
89
90
assert plugin .python_class .x == 1
90
91
assert plugin .python_class .y == 2
91
-
0 commit comments