From: Sage Weil Date: Thu, 20 Jan 2022 18:15:06 +0000 (-0500) Subject: pybind/mgr/tests: fix style X-Git-Tag: v18.0.0~1501^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F44695%2Fhead;p=ceph.git pybind/mgr/tests: fix style Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/tests/__init__.py b/src/pybind/mgr/tests/__init__.py index 68b61e7ec523..633959084ccb 100644 --- a/src/pybind/mgr/tests/__init__.py +++ b/src/pybind/mgr/tests/__init__.py @@ -62,7 +62,7 @@ if 'UNITTEST' in os.environ: def _ceph_get_store_prefix(self, prefix): return self.mock_store_prefix('store', prefix) - def _ceph_get_module_option(self, module, key, localized_prefix= None): + def _ceph_get_module_option(self, module, key, localized_prefix=None): try: _, val, _ = self.check_mon_command({ 'prefix': 'config get', @@ -108,7 +108,7 @@ if 'UNITTEST' in os.environ: # Mocking the config store is handy sometimes: def config_get(): who = cmd['who'].split('.') - whos = ['global'] + ['.'.join(who[:i+1]) for i in range(len(who))] + whos = ['global'] + ['.'.join(who[:i + 1]) for i in range(len(who))] for attepmt in reversed(whos): val = self.mock_store_get('config', f'{attepmt}/{cmd["key"]}', None) if val is not None: @@ -151,7 +151,7 @@ if 'UNITTEST' in os.environ: def _ceph_get_foreign_option(self, entity, name): who = entity.split('.') - whos = ['global'] + ['.'.join(who[:i+1]) for i in range(len(who))] + whos = ['global'] + ['.'.join(who[:i + 1]) for i in range(len(who))] for attepmt in reversed(whos): val = self.mock_store_get('config', f'{attepmt}/{name}', None) if val is not None: @@ -174,7 +174,6 @@ if 'UNITTEST' in os.environ: if not hasattr(self, '_store'): self._store = {} - if self.__class__ not in M_classes: # call those only once. self._register_commands('') @@ -194,7 +193,6 @@ if 'UNITTEST' in os.environ: self._ceph_dispatch_remote = lambda *_: None self._ceph_get_mgr_id = mock.MagicMock() - cm = mock.Mock() cm.BaseMgrModule = M cm.BaseMgrStandbyModule = M diff --git a/src/pybind/mgr/tests/test_tls.py b/src/pybind/mgr/tests/test_tls.py index 923d91917caf..fda463cd2f4d 100644 --- a/src/pybind/mgr/tests/test_tls.py +++ b/src/pybind/mgr/tests/test_tls.py @@ -15,7 +15,8 @@ class TLSchecks(unittest.TestCase): verify_tls(crt, key) def test_invalid_RDN(self): - self.assertRaises(ValueError, create_self_signed_cert, dname={'O': 'Ceph', 'Bogus': 'testsuite'}) + self.assertRaises(ValueError, create_self_signed_cert, + dname={'O': 'Ceph', 'Bogus': 'testsuite'}) def test_invalid_key(self): crt, key = create_self_signed_cert()