Skip to content

Commit 0ef5989

Browse files
author
Your Name
committed
fix ruff on unittests
1 parent e38c822 commit 0ef5989

2 files changed

Lines changed: 9 additions & 20 deletions

File tree

dojo/tools/reversinglabs_spectraassure/parser.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
1+
from typing import Any
12
import hashlib
23
import logging
3-
from typing import Any
4-
5-
# any line after FIX_START and before FIX_END
6-
# will be rewritten when copy to the dev machine
7-
# commented lines will be uncommented
8-
# and uncommented lines will be commented
9-
# //
10-
# FIX_START
114
from dojo.models import Finding
125
from dojo.tools.reversinglabs_spectraassure.rlJsonInfo import RlJsonInfo
136
from dojo.tools.reversinglabs_spectraassure.rlJsonInfo.cve_info_node import CveInfoNode
14-
# from finding import Finding
15-
#
16-
# from .rlJsonInfo import RlJsonInfo
17-
# from .rlJsonInfo.cve_info_node import CveInfoNode
18-
#
19-
# FIX_END
207

218
logger = logging.getLogger(__name__)
229

unittests/tools/test_reversinglabs_spectraassure_parser.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
# Product,
1717
Test,
1818
)
19-
from dojo.tools.reversinglabs_spectraassure.parser import (
20-
ReversinglabsSpectraassureParser,
21-
)
2219
from unittests.dojo_test_case import (
2320
DojoTestCase,
2421
get_unit_tests_scans_path,
2522
)
2623

24+
from dojo.tools.reversinglabs_spectraassure.parser import (
25+
ReversinglabsSpectraassureParser,
26+
)
27+
2728
_WHERE = "reversinglabs_spectraassure"
2829

2930
_FILES = [
@@ -33,7 +34,8 @@
3334
]
3435

3536

36-
class TestReversingLabsSpectraAssureParser(DojoTestCase): # type: ignore
37+
# mypy gives: error: Class cannot subclass "DojoTestCase" (has type "Any") [misc]
38+
class TestReversingLabsSpectraAssureParser(DojoTestCase): # type: ignore[misc]
3739
def common_checks(self, finding: Finding) -> None:
3840
self.assertLessEqual(len(finding.title), 250)
3941
self.assertIn(finding.severity, Finding.SEVERITIES)
@@ -56,7 +58,7 @@ def test_parse_file_with_no_vuln(self) -> None:
5658

5759
def test_parse_file_with_one_vuln(self) -> None:
5860
with (get_unit_tests_scans_path(_WHERE) / "putty_win_x64-0.80.exe-report.rl.json").open(
59-
encoding="utf-8"
61+
encoding="utf-8",
6062
) as testfile:
6163
parser = ReversinglabsSpectraassureParser()
6264
findings = parser.get_findings(
@@ -70,7 +72,7 @@ def test_parse_file_with_one_vuln(self) -> None:
7072

7173
def test_parse_file_with_many_vulns(self) -> None:
7274
with (get_unit_tests_scans_path(_WHERE) / "HxDSetup_2.5.0.exe-report.rl.json").open(
73-
encoding="utf-8"
75+
encoding="utf-8",
7476
) as testfile:
7577
parser = ReversinglabsSpectraassureParser()
7678
findings = parser.get_findings(

0 commit comments

Comments
 (0)