Skip to content

Commit

Permalink
pybind/mgr/tests: fix style
Browse files Browse the repository at this point in the history
Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Jan 20, 2022
1 parent 538aa10 commit 8c7808d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/pybind/mgr/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _ceph_set_store(self, k, v):
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',
Expand Down Expand Up @@ -108,7 +108,7 @@ def _ceph_send_command(self, res, svc_type, svc_id, command, tag, inbuf):
# 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:
Expand Down Expand Up @@ -151,7 +151,7 @@ def config_dump():

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:
Expand All @@ -174,7 +174,6 @@ def __init__(self, *args):
if not hasattr(self, '_store'):
self._store = {}


if self.__class__ not in M_classes:
# call those only once.
self._register_commands('')
Expand All @@ -194,7 +193,6 @@ def __init__(self, *args):
self._ceph_dispatch_remote = lambda *_: None
self._ceph_get_mgr_id = mock.MagicMock()


cm = mock.Mock()
cm.BaseMgrModule = M
cm.BaseMgrStandbyModule = M
Expand Down
3 changes: 2 additions & 1 deletion src/pybind/mgr/tests/test_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def test_specific_dname(self):
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()
Expand Down

0 comments on commit 8c7808d

Please sign in to comment.