added response_timestamps to ios_xr_command module (#50095)

This commit is contained in:
vaneuk 2019-02-04 16:19:07 +03:00 committed by Trishna Guha
parent daf1cfbde0
commit 2a0c356da9
4 changed files with 17 additions and 6 deletions

View file

@ -20,6 +20,7 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import patch
from ansible.module_utils.basic import get_timestamp
from ansible.modules.network.iosxr import iosxr_command
from units.modules.utils import set_module_args
from .iosxr_module import TestIosxrModule, load_fixture
@ -45,6 +46,7 @@ class TestIosxrCommandModule(TestIosxrModule):
def load_from_file(*args, **kwargs):
module, commands = args
output = list()
timestamps = list()
for item in commands:
try:
@ -53,7 +55,8 @@ class TestIosxrCommandModule(TestIosxrModule):
command = item
filename = str(command).replace(' ', '_')
output.append(load_fixture(filename))
return output
timestamps.append(get_timestamp())
return output, timestamps
self.run_commands.side_effect = load_from_file