fixes error when trying to run show start over eapi (#26800)

This commit is contained in:
Peter Sprygada 2017-07-14 09:07:44 -04:00 committed by Ricardo Carrillo Cruz
parent 156b29b26b
commit 3bbb32cac5
3 changed files with 54 additions and 7 deletions

View file

@ -132,3 +132,23 @@ class TestEosConfigModule(TestEosModule):
set_module_args(args)
result = self.execute_module()
self.assertIn('__backup__', result)
def test_eos_config_save_when(self):
mock_run_commands = patch('ansible.modules.network.eos.eos_config.run_commands')
run_commands = mock_run_commands.start()
run_commands.return_value = [load_fixture('eos_config_config.cfg'),
load_fixture('eos_config_config.cfg')]
args = dict(save_when='modified')
set_module_args(args)
result = self.execute_module()
run_commands.return_value = [load_fixture('eos_config_config.cfg'),
load_fixture('eos_config_config_updated.cfg')]
args = dict(save_when='modified')
set_module_args(args)
result = self.execute_module(changed=True)
mock_run_commands.stop()