Skip to content

Commit 8eb26a9

Browse files
fix tests
1 parent 6bee447 commit 8eb26a9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

dojo/validators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ def cvss3_validator(value: str | list[str], exception_class: Callable = Validati
3737
return
3838

3939
if isinstance(vector_obj, CVSS4):
40-
msg = "CVSS(4) vector vannot be stored in the cvss3 field. Use the cvss4 fields."
40+
msg = "CVSS4 vector vannot be stored in the cvss3 field. Use the cvss4 field."
4141
raise exception_class(msg)
4242
if isinstance(vector_obj, CVSS2):
43-
msg = "Unsupported CVSS(2) version detected."
43+
msg = "Unsupported CVSS2 version detected."
4444
raise exception_class(msg)
4545

4646
msg = "Unsupported CVSS version detected."
@@ -64,10 +64,10 @@ def cvss4_validator(value: str | list[str], exception_class: Callable = Validati
6464
return
6565

6666
if isinstance(vector_obj, CVSS3):
67-
msg = "CVSS(3) vector vannot be stored in the cvss3 field. Use the cvss3 fields."
67+
msg = "CVSS3 vector vannot be stored in the cvss3 field. Use the cvss3 field."
6868
raise exception_class(msg)
6969
if isinstance(vector_obj, CVSS2):
70-
msg = "Unsupported CVSS(2) version detected."
70+
msg = "Unsupported CVSS2 version detected."
7171
raise exception_class(msg)
7272

7373
msg = "Unsupported CVSS version detected."

tests/finding_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def test_edit_finding_cvssv3_with_v2_vector(self):
247247
expected_cvssv3_value="AV:N/AC:L/Au:N/C:P/I:P/A:P",
248248
expected_cvssv3_score="4",
249249
expect_success=False,
250-
error_message="Unsupported CVSS(2) version detected.",
250+
error_message="Unsupported CVSS2 version detected.",
251251
)
252252

253253
@on_exception_html_source_logger
@@ -258,7 +258,7 @@ def test_edit_finding_cvssv3_with_v4_vector(self):
258258
expected_cvssv3_value="CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
259259
expected_cvssv3_score="5",
260260
expect_success=False,
261-
error_message="No valid CVSS3 vectors found by cvss.parse_cvss_from_text()",
261+
error_message="CVSS4 vector vannot be stored in the cvss3 field. Use the cvss4 field.",
262262
)
263263

264264
@on_exception_html_source_logger
@@ -334,7 +334,7 @@ def test_edit_finding_cvssv4_with_v2_vector(self):
334334
expected_cvssv4_value="AV:N/AC:L/Au:N/C:P/I:P/A:P",
335335
expected_cvssv4_score="4",
336336
expect_success=False,
337-
error_message="Unsupported CVSS(2) version detected.",
337+
error_message="Unsupported CVSS2 version detected.",
338338
)
339339

340340
@on_exception_html_source_logger
@@ -345,7 +345,7 @@ def test_edit_finding_cvssv4_with_v3_vector(self):
345345
expected_cvssv4_value="CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
346346
expected_cvssv4_score="5",
347347
expect_success=False,
348-
error_message="CVSS(3) vector vannot be stored in the cvss3 field. Use the cvss3 fields.",
348+
error_message="CVSS3 vector vannot be stored in the cvss4 field. Use the cvss3 field.",
349349
)
350350

351351
@on_exception_html_source_logger

0 commit comments

Comments
 (0)