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