Unit test may failed without client_factory.init()
Such as the title
Change-Id: Ia1e77d29332ddbfb9462fa093858c1e9cda90b78
(cherry picked from commit ec8e3bbcfb
)
This commit is contained in:
parent
23812aec34
commit
1e37b7f26a
|
@ -19,6 +19,7 @@ from karbor.resource import Resource
|
|||
from karbor.services.protection.bank_plugin import Bank
|
||||
from karbor.services.protection.bank_plugin import BankPlugin
|
||||
from karbor.services.protection.bank_plugin import BankSection
|
||||
from karbor.services.protection import client_factory
|
||||
from karbor.services.protection.protection_plugins.server \
|
||||
import server_plugin_schemas
|
||||
from karbor.services.protection.protection_plugins.server. \
|
||||
|
@ -277,6 +278,10 @@ def call_hooks(operation, checkpoint, resource, context, parameters, **kwargs):
|
|||
class NovaProtectionPluginTest(base.TestCase):
|
||||
def setUp(self):
|
||||
super(NovaProtectionPluginTest, self).setUp()
|
||||
with mock.patch.object(
|
||||
client_factory.karbor_keystone_plugin.KarborKeystonePlugin,
|
||||
'_do_init'):
|
||||
client_factory.init()
|
||||
self.cntxt = RequestContext(user_id='demo',
|
||||
project_id='abcd',
|
||||
auth_token='efgh')
|
||||
|
|
Loading…
Reference in New Issue