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:
Nathaniel Case
2017-06-27 12:45:36 -04:00
committed by GitHub
parent 79b2897462
commit 3d6d428bbc
30 changed files with 86 additions and 72 deletions

View File

@@ -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