Add time.sleep mock for test_lv_deactivate_timeout

We don't need to wait 30 seconds in unit tests for retries.
This patch adds mock for time.sleep to make tests faster.

Change-Id: Id20f2c26fd352227df11e19b6558beb0f7c2fa8b
This commit is contained in:
Ivan Kolodyazhny 2017-05-22 18:50:54 +03:00
parent 03c00d9028
commit 49618ee9be
1 changed files with 2 additions and 1 deletions

View File

@ -429,7 +429,8 @@ class BrickLvmTestCase(test.TestCase):
self.vg.create_volume('test', '1G')
self.vg.deactivate_lv('test')
def test_lv_deactivate_timeout(self):
@mock.patch('time.sleep')
def test_lv_deactivate_timeout(self, _mock_sleep):
with mock.patch.object(self.vg, '_execute'):
is_active_mock = mock.Mock()
is_active_mock.return_value = True