Revision 08cef8fc test/py/cmdlib/testsupport/iallocator_mock.py
b/test/py/cmdlib/testsupport/iallocator_mock.py | ||
---|---|---|
22 | 22 |
"""Support for mocking the IAllocator interface""" |
23 | 23 |
|
24 | 24 |
|
25 |
import mock
|
|
25 |
from cmdlib.testsupport.util import patchModule
|
|
26 | 26 |
|
27 | 27 |
|
28 | 28 |
# pylint: disable=C0103 |
... | ... | |
36 | 36 |
"ganeti.cmdlib" prefix is optional. |
37 | 37 |
|
38 | 38 |
""" |
39 |
if not module_under_test.startswith("ganeti.cmdlib"): |
|
40 |
module_under_test = "ganeti.cmdlib." + module_under_test |
|
41 |
return mock.patch("%s.iallocator.IAllocator" % module_under_test) |
|
39 |
return patchModule(module_under_test, "iallocator.IAllocator") |
Also available in: Unified diff