diff options
author | Kate Case <kcase@redhat.com> | 2023-02-07 13:11:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-07 18:11:59 +0000 |
commit | dac4b610c8a0dd67fad408649d855b8384017ddd (patch) | |
tree | f0ae8b94393a92227cf8210dc3146b9c30e4a541 /tests | |
parent | a4a40e9d4ec540fae1b4ecb1622786d0832ed840 (diff) | |
download | vyos.vyos-dac4b610c8a0dd67fad408649d855b8384017ddd.tar.gz vyos.vyos-dac4b610c8a0dd67fad408649d855b8384017ddd.zip |
[command] run at least once when retries is 0 (#292)
* [command] run at least once when retries is 0
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/modules/network/vyos/test_vyos_command.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/unit/modules/network/vyos/test_vyos_command.py b/tests/unit/modules/network/vyos/test_vyos_command.py index 7ed049be..e03ea7db 100644 --- a/tests/unit/modules/network/vyos/test_vyos_command.py +++ b/tests/unit/modules/network/vyos/test_vyos_command.py @@ -85,7 +85,13 @@ class TestVyosCommandModule(TestVyosModule): wait_for = 'result[0] contains "test string"' set_module_args(dict(commands=["show version"], wait_for=wait_for, retries=2)) self.execute_module(failed=True) - self.assertEqual(self.run_commands.call_count, 2) + self.assertEqual(self.run_commands.call_count, 3) + + def test_vyos_command_no_retries(self): + wait_for = 'result[0] contains "test string"' + set_module_args(dict(commands=["show version"], wait_for=wait_for, retries=0)) + self.execute_module(failed=True) + self.assertEqual(self.run_commands.call_count, 1) def test_vyos_command_match_any(self): wait_for = [ |