mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-05 12:52:48 +00:00
added response_timestamps to ios_xr_command module (#50095)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user