Skip to content

Commit

Permalink
satisfy pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
Kraemii authored and ArnoStiefvater committed Jun 28, 2021
1 parent 431c42b commit 88f4ac5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ospd_openvas/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
if SENTRY_DSN_OSPD_OPENVAS:
import sentry_sdk

sentry_sdk.init(
sentry_sdk.init( # pylint: disable=abstract-class-instantiated
SENTRY_DSN_OSPD_OPENVAS,
traces_sample_rate=1.0,
server_name=environ.get('SENTRY_SERVER_NAME'),
Expand Down
4 changes: 3 additions & 1 deletion tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,7 @@ def assert_called_once(mock: Mock):
def assert_called(mock: Mock):
"""assert that the mock was called at least once"""
if mock.call_count == 0:
msg = "Expected '%s' to have been called." % (mock._mock_name or 'mock')
msg = "Expected '%s' to have been called." % (
mock._mock_name or 'mock' # pylint: disable=protected-access
)
raise AssertionError(msg)
4 changes: 2 additions & 2 deletions tests/test_preferencehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,8 +1237,8 @@ def test_prepare_alive_test_not_supplied_as_enum(self, mock_kb):
p_handler.prepare_alive_test_option_for_openvas()

self.assertEqual(
p_handler._nvts_params,
alive_test_out, # pylint: disable = protected-access
p_handler._nvts_params, # pylint: disable = protected-access
alive_test_out,
)

@patch('ospd_openvas.db.KbDB')
Expand Down
22 changes: 15 additions & 7 deletions tests/test_vthelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def test_get_single_vt_severity_cvssv3(self):
'excluded_keys': 'Settings/disable_cgi_scanning',
'family': 'Product detection',
'filename': 'mantis_detect.nasl',
'last_modification': ('1533906565'),
'last_modification': '1533906565',
'name': 'Mantis Detection',
'qod_type': 'remote_banner',
'required_ports': 'Services/www, 80',
Expand All @@ -104,7 +104,7 @@ def test_get_single_vt_severity_cvssv3(self):
'solution_method': 'DebianAPTUpgrade',
'impact': 'some impact',
'insight': 'some insight',
'summary': ('some summary'),
'summary': 'some summary',
'affected': 'some affection',
'timeout': '0',
'vt_params': {
Expand All @@ -119,7 +119,10 @@ def test_get_single_vt_severity_cvssv3(self):
'id': '2',
'default': 'no',
'description': 'Description',
'name': 'Do not randomize the order in which ports are scanned', # pylint: disable=line-too-long
'name': ( # pylint: disable=line-too-long
'Do not randomize the order in which ports are'
' scanned'
),
'type': 'checkbox',
},
},
Expand Down Expand Up @@ -153,7 +156,7 @@ def test_get_single_vt_severity_cvssv2(self):
'excluded_keys': 'Settings/disable_cgi_scanning',
'family': 'Product detection',
'filename': 'mantis_detect.nasl',
'last_modification': ('1533906565'),
'last_modification': '1533906565',
'name': 'Mantis Detection',
'qod_type': 'remote_banner',
'required_ports': 'Services/www, 80',
Expand All @@ -162,7 +165,7 @@ def test_get_single_vt_severity_cvssv2(self):
'solution_method': 'DebianAPTUpgrade',
'impact': 'some impact',
'insight': 'some insight',
'summary': ('some summary'),
'summary': 'some summary',
'affected': 'some affection',
'timeout': '0',
'vt_params': {
Expand All @@ -177,7 +180,10 @@ def test_get_single_vt_severity_cvssv2(self):
'id': '2',
'default': 'no',
'description': 'Description',
'name': 'Do not randomize the order in which ports are scanned', # pylint: disable=line-too-long
'name': ( # pylint: disable=line-too-long
'Do not randomize the order in which ports are'
' scanned'
),
'type': 'checkbox',
},
},
Expand Down Expand Up @@ -220,7 +226,9 @@ def test_get_severity_score_v3(self):
vtaux = {
'severities': {
'severity_type': 'cvss_base_v3',
'severity_base_vector': 'CVSS:3.0/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:L/A:L',
'severity_base_vector': (
'CVSS:3.0/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:L/A:L'
),
}
}

Expand Down

0 comments on commit 88f4ac5

Please sign in to comment.