mirror of
https://github.com/jtesta/ssh-audit.git
synced 2024-11-16 13:35:39 +01:00
Fixed pylint & flake8 warnings and errors.
This commit is contained in:
parent
0b8ecf2fb5
commit
b9520cbc25
@ -325,7 +325,7 @@ class SSH_Socket(ReadBuf, WriteBuf):
|
||||
self.__header = []
|
||||
self.__banner = None
|
||||
|
||||
def _close_socket(self, s: Optional[socket.socket]) -> None: # pylint: disable=no-self-use
|
||||
def _close_socket(self, s: Optional[socket.socket]) -> None:
|
||||
try:
|
||||
if s is not None:
|
||||
s.shutdown(socket.SHUT_RDWR)
|
||||
|
@ -41,15 +41,15 @@ class TestPolicy:
|
||||
for policy_name in Policy.BUILTIN_POLICIES:
|
||||
# Ensure that the policy name ends with " (version X)", where X is the 'version' field.
|
||||
version_str = " (version %s)" % Policy.BUILTIN_POLICIES[policy_name]['version']
|
||||
assert(policy_name.endswith(version_str))
|
||||
assert policy_name.endswith(version_str)
|
||||
|
||||
# Ensure that each built-in policy can be loaded with Policy.load_builtin_policy().
|
||||
assert(Policy.load_builtin_policy(policy_name) is not None)
|
||||
assert Policy.load_builtin_policy(policy_name) is not None
|
||||
|
||||
# Ensure that both server and client policy names are returned.
|
||||
server_policy_names, client_policy_names = Policy.list_builtin_policies()
|
||||
assert(len(server_policy_names) > 0)
|
||||
assert(len(client_policy_names) > 0)
|
||||
assert len(server_policy_names) > 0
|
||||
assert len(client_policy_names) > 0
|
||||
|
||||
|
||||
def test_policy_basic(self):
|
||||
|
2
tox.ini
2
tox.ini
@ -91,14 +91,12 @@ reports = no
|
||||
#output-format = colorized
|
||||
indent-string = " "
|
||||
disable =
|
||||
bad-continuation,
|
||||
broad-except,
|
||||
duplicate-code,
|
||||
fixme,
|
||||
invalid-name,
|
||||
line-too-long,
|
||||
missing-docstring,
|
||||
mixed-indentation,
|
||||
no-else-raise,
|
||||
no-else-return,
|
||||
super-with-arguments, # Can be re-factored, at some point.
|
||||
|
Loading…
Reference in New Issue
Block a user