mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-30 14:21:26 -07:00
ios test changes (#35510)
* Fix over-byte * Update ios tests to call `provider` To continue to support testing `connection: local` * Fix command dict handling in ios_user * Clean up unit tests, too
This commit is contained in:
parent
d7d9e40dd1
commit
f3337e1fba
49 changed files with 240 additions and 243 deletions
|
@ -57,15 +57,14 @@ class TestIosUserModule(TestIosModule):
|
|||
def test_ios_user_delete(self):
|
||||
set_module_args(dict(name='ansible', state='absent'))
|
||||
result = self.execute_module(changed=True)
|
||||
cmd = json.loads(
|
||||
'{"answer": "y", "newline": false, ' +
|
||||
'"prompt": "This operation will remove all username related ' +
|
||||
'configurations with same name", "command": "no username ansible"}'
|
||||
)
|
||||
cmd = {
|
||||
"command": "no username ansible", "answer": "y", "newline": False,
|
||||
"prompt": "This operation will remove all username related configurations with same name",
|
||||
}
|
||||
|
||||
result_cmd = []
|
||||
for i in result['commands']:
|
||||
result_cmd.append(json.loads(i))
|
||||
result_cmd.append(i)
|
||||
|
||||
self.assertEqual(result_cmd, [cmd])
|
||||
|
||||
|
@ -86,15 +85,14 @@ class TestIosUserModule(TestIosModule):
|
|||
def test_ios_user_purge(self):
|
||||
set_module_args(dict(purge=True))
|
||||
result = self.execute_module(changed=True)
|
||||
cmd = json.loads(
|
||||
'{"answer": "y", "newline": false, ' +
|
||||
'"prompt": "This operation will remove all username related ' +
|
||||
'configurations with same name", "command": "no username ansible"}'
|
||||
)
|
||||
cmd = {
|
||||
"command": "no username ansible", "answer": "y", "newline": False,
|
||||
"prompt": "This operation will remove all username related configurations with same name",
|
||||
}
|
||||
|
||||
result_cmd = []
|
||||
for i in result['commands']:
|
||||
result_cmd.append(json.loads(i))
|
||||
result_cmd.append(i)
|
||||
|
||||
self.assertEqual(result_cmd, [cmd])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue