Merge "Mock time.sleep in tests that sleep"

This commit is contained in:
Jenkins 2017-02-11 16:37:44 +00:00 committed by Gerrit Code Review
commit 5ccc6ce4fa
2 changed files with 4 additions and 0 deletions

View File

@ -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)

View File

@ -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'])