Merge "Mock time.sleep in tests that sleep"
This commit is contained in:
commit
5ccc6ce4fa
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
import os
|
||||
import time
|
||||
|
||||
import mock
|
||||
|
||||
@ -208,6 +209,7 @@ class CopyClassTestCase(test.TestCase):
|
||||
self.mock_object(utils, 'execute', mock.Mock(
|
||||
side_effect=get_output))
|
||||
self.mock_object(self._copy, 'get_progress')
|
||||
self.mock_object(time, 'sleep')
|
||||
|
||||
# run
|
||||
self._copy.copy_data(self._copy.src)
|
||||
|
@ -14,6 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
import copy
|
||||
import time
|
||||
|
||||
import ddt
|
||||
from lxml import builder
|
||||
@ -111,6 +112,7 @@ class StorageObjectTestCase(StorageObjectTestCaseBase):
|
||||
fake_req = storage_object._build_task_package(
|
||||
elt_maker.StartFake(name='foo')
|
||||
)
|
||||
self.mock_object(time, 'sleep')
|
||||
resp = storage_object._send_request(fake_req)
|
||||
self.assertEqual('ok', resp['maxSeverity'])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user