BIND 10 trac2353, updated. 87cd15b3cc34738753d97e62a07681b245350f25 [2353] Restore time.time() and time.sleep() during tearDown()
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Dec 6 02:44:00 UTC 2012
The branch, trac2353 has been updated
via 87cd15b3cc34738753d97e62a07681b245350f25 (commit)
from 3c17e9586c94a0e4331cafe79e379e71f3d8a561 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 87cd15b3cc34738753d97e62a07681b245350f25
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu Dec 6 08:13:47 2012 +0530
[2353] Restore time.time() and time.sleep() during tearDown()
-----------------------------------------------------------------------
Summary of changes:
src/bin/bind10/tests/bind10_test.py.in | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/bind10/tests/bind10_test.py.in b/src/bin/bind10/tests/bind10_test.py.in
index a0bfbef..2bf16ca 100644
--- a/src/bin/bind10/tests/bind10_test.py.in
+++ b/src/bin/bind10/tests/bind10_test.py.in
@@ -1231,6 +1231,16 @@ class TestBossComponents(unittest.TestCase):
'process': 'cat'
}
}
+ self._tmp_time = None
+ self._tmp_sleep = None
+
+ def tearDown(self):
+ if self._tmp_time is not None:
+ time.time = self._tmp_time
+ if self._tmp_sleep is not None:
+ time.sleep = self._tmp_sleep
+
+
def __unary_hook(self, param):
"""
@@ -1610,8 +1620,8 @@ class TestBossComponents(unittest.TestCase):
global tsec
attempts = 0
tsec = 0
- tmp_time = time.time
- tmp_sleep = time.sleep
+ self._tmp_time = time.time
+ self._tmp_sleep = time.sleep
def _my_time():
global attempts
global tsec
@@ -1633,8 +1643,7 @@ class TestBossComponents(unittest.TestCase):
# to happen inside start_msgq().
self.assertEqual(attempts, 13)
- time.time = tmp_time
- time.sleep = tmp_sleep
+ # time.time() and time.sleep() are restored during tearDown().
def test_start_cfgmgr(self):
'''Test that b10-cfgmgr is started.'''
@@ -1717,7 +1726,7 @@ class TestBossComponents(unittest.TestCase):
global attempts
attempts = 0
- tmp_sleep = time.sleep
+ self._tmp_sleep = time.sleep
def _my_sleep(nsec):
global attempts
attempts += 1
@@ -1736,7 +1745,7 @@ class TestBossComponents(unittest.TestCase):
# 2 seconds of attempts every 1 second should result in 2 attempts
self.assertEqual(attempts, 2)
- time.sleep = tmp_sleep
+ # time.sleep() is restored during tearDown().
def test_start_ccsession(self):
'''Test that CC session is started.'''
More information about the bind10-changes
mailing list