mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #15281 from jpic/fix_plugin_configuration
Regression fix: proper plugin configuration was reset
This commit is contained in:
commit
6a3670b1f0
2 changed files with 14 additions and 1 deletions
|
@ -66,7 +66,7 @@ class PluginLoader:
|
|||
|
||||
if config and not isinstance(config, list):
|
||||
config = [config]
|
||||
else:
|
||||
elif not config:
|
||||
config = []
|
||||
|
||||
self.config = config
|
||||
|
|
|
@ -75,3 +75,16 @@ class TestErrors(unittest.TestCase):
|
|||
#with patch('glob.glob', mock_glob):
|
||||
# pass
|
||||
|
||||
def assertPluginLoaderConfigBecomes(self, arg, expected):
|
||||
pl = PluginLoader('test', '', arg, 'test_plugin')
|
||||
self.assertEqual(pl.config, expected)
|
||||
|
||||
def test_plugin__init_config_list(self):
|
||||
config = ['/one', '/two']
|
||||
self.assertPluginLoaderConfigBecomes(config, config)
|
||||
|
||||
def test_plugin__init_config_str(self):
|
||||
self.assertPluginLoaderConfigBecomes('test', ['test'])
|
||||
|
||||
def test_plugin__init_config_none(self):
|
||||
self.assertPluginLoaderConfigBecomes(None, [])
|
||||
|
|
Loading…
Reference in a new issue