mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-03 06:49:10 -07:00
added response_timestamps to ios_xr_command module (#50095)
This commit is contained in:
parent
daf1cfbde0
commit
2a0c356da9
4 changed files with 17 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue