mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Test multiple nxos versions at once (#25595)
* Extend tests to have multiple device representations * Move filepath munging to nxos_module * Device needs to be kwarg so we can leave it off * Update other nxos tests * Update tests that fell through
This commit is contained in:
@@ -37,7 +37,7 @@ class TestNxosCommandModule(TestNxosModule):
|
||||
def tearDown(self):
|
||||
self.mock_run_commands.stop()
|
||||
|
||||
def load_fixtures(self, commands=None):
|
||||
def load_fixtures(self, commands=None, device=''):
|
||||
def load_from_file(*args, **kwargs):
|
||||
module, commands = args
|
||||
output = list()
|
||||
@@ -48,9 +48,8 @@ class TestNxosCommandModule(TestNxosModule):
|
||||
command = obj['command']
|
||||
except ValueError:
|
||||
command = item['command']
|
||||
filename = str(command).replace(' ', '_')
|
||||
filename = 'nxos_command/%s.txt' % filename
|
||||
output.append(load_fixture(filename))
|
||||
filename = '%s.txt' % str(command).replace(' ', '_')
|
||||
output.append(load_fixture('nxos_command', filename))
|
||||
return output
|
||||
|
||||
self.run_commands.side_effect = load_from_file
|
||||
|
||||
Reference in New Issue
Block a user