mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-24 01:49:08 -07:00
Reduces the unit test time of select bigip modules (#36256)
The modules in this patch include waits that need to happen to ensure something is correctly configured on a BIG-IP. These waits were raised as an issue in a recent ansible-testing meeting. This patch eliminates the waits by mocking time.sleep
This commit is contained in:
parent
fed20b825f
commit
77fa41795e
10 changed files with 51 additions and 1 deletions
|
@ -93,6 +93,11 @@ class TestParameters(unittest.TestCase):
|
|||
class TestManager(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.spec = ArgumentSpec()
|
||||
self.patcher1 = patch('time.sleep')
|
||||
self.patcher1.start()
|
||||
|
||||
def tearDown(self):
|
||||
self.patcher1.stop()
|
||||
|
||||
def test_wait_already_available(self, *args):
|
||||
set_module_args(dict(
|
||||
|
@ -115,4 +120,4 @@ class TestManager(unittest.TestCase):
|
|||
results = mm.exec_module()
|
||||
|
||||
assert results['changed'] is False
|
||||
assert results['elapsed'] == 1
|
||||
assert results['elapsed'] == 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue