diff --git a/manila/tests/share/drivers/windows/test_service_instance.py b/manila/tests/share/drivers/windows/test_service_instance.py index 7c359e0346..17113c5044 100644 --- a/manila/tests/share/drivers/windows/test_service_instance.py +++ b/manila/tests/share/drivers/windows/test_service_instance.py @@ -19,6 +19,7 @@ import ddt import mock from oslo_concurrency import processutils from oslo_config import cfg +import six from manila import exception from manila.share import configuration @@ -82,7 +83,7 @@ class WindowsServiceInstanceManagerTestCase(test.TestCase): if not use_cert_auth: mock_check_complexity.assert_called_once_with( - mock.sentinel.password) + six.text_type(mock.sentinel.password)) @ddt.data(False, True) def test_get_auth_info(self, use_cert_auth): @@ -165,7 +166,7 @@ class WindowsServiceInstanceManagerTestCase(test.TestCase): expected_kwargs = dict(user_data=mock_cert_data) else: expected_kwargs = dict( - meta=dict(admin_pass=mock.sentinel.admin_pass)) + meta=dict(admin_pass=six.text_type(mock.sentinel.admin_pass))) create_kwargs = self._mgr._get_service_instance_create_kwargs() diff --git a/manila/tests/share/test_hook.py b/manila/tests/share/test_hook.py index 1d3dceadeb..d136f63cfa 100644 --- a/manila/tests/share/test_hook.py +++ b/manila/tests/share/test_hook.py @@ -41,17 +41,17 @@ class HookBaseTestCase(test.TestCase): super(HookBaseTestCase, self).setUp() self.context = context.get_admin_context() self.default_config = { - "enable_pre_hooks": "fake_enable_pre_hooks", - "enable_post_hooks": "fake_enable_post_hooks", - "enable_periodic_hooks": "fake_enable_periodic_hooks", - "suppress_pre_hooks_errors": "fake_suppress_pre_hook_errors", - "suppress_post_hooks_errors": "fake_suppress_post_hook_errors", + "enable_pre_hooks": True, + "enable_post_hooks": True, + "enable_periodic_hooks": True, + "suppress_pre_hooks_errors": True, + "suppress_post_hooks_errors": True, } for k, v in self.default_config.items(): hook.CONF.set_default(k, v) def _fake_safe_get(self, key): - return self.default_config.get(key) + "_safe_get" + return self.default_config.get(key) def _get_hook_instance(self, set_configuration=True, host="fake_host"): if set_configuration: