Convert apply_result to mock object

Follow-Up of https://review.opendev.org/703439

Change-Id: I8798771a93a4bc6c564cffed265d015490261c4f
This commit is contained in:
Riccardo Pittau 2020-02-11 15:54:51 +01:00
parent 48ef7c9188
commit 530ae44145
1 changed files with 2 additions and 3 deletions

View File

@ -13,7 +13,6 @@
# limitations under the License.
import binascii
import multiprocessing
import os
import time
@ -1830,10 +1829,10 @@ class TestGenericHardwareManager(base.IronicAgentTest):
internal_info['disk_erasure_concurrency'] = 10
mocked_dispatch.return_value = 'erased device'
apply_result = multiprocessing.pool.ApplyResult
apply_result = mock.Mock()
apply_result._success = True
apply_result._ready = True
apply_result.get = lambda: 'erased device'
apply_result.get.return_value = 'erased device'
mocked_async.return_value = apply_result
blkdev1 = hardware.BlockDevice('/dev/sdj', 'big', 1073741824, True)