more changes

This commit is contained in:
David Duran Rosich committed 2026-10-24 23:55:11 +02:00
1 parent a8241fa648
commit 8a5c712ef0
3 files changed
+26 -21

No files matched your search

+7 -5
View File
@@ -475,7 +475,8 @@ class ReportTests(unittest.TestCase):
)
self.assertIn("Image: nginx:1.27", body)
self.assertIn("Container: web", body)
self.assertIn("Total: 3 (fixable: 2, unfixable: 1)", body)
self.assertIn("C 1/1 | H 1/2 | M 0/0 | L 0/0", body)
self.assertIn("Total: 2/3 (fixable/total)", body)
self.assertIn("CVE-1", body)
self.assertIn("CVE-2", body)
self.assertIn("CVE-5", body)
@@ -491,7 +492,8 @@ class ReportTests(unittest.TestCase):
self.assertIn("CVE-1", body)
self.assertNotIn("CVE-2", body)
self.assertNotIn("CVE-5", body)
self.assertIn("Total: 1 (fixable: 1, unfixable: 0)", body)
self.assertIn("C 1/1 | H 0/0 | M 0/0 | L 0/0", body)
self.assertIn("Total: 1/1 (fixable/total)", body)
def test_build_other_containers_body_has_counts_per_container(self) -> None:
body = scan.build_other_containers_body(
@@ -500,8 +502,8 @@ class ReportTests(unittest.TestCase):
("redis:7", "cache", 4, 0, 4),
]
)
self.assertIn("* nginx:1.27 [web-worker]: 3 total (2 fixable, 1 unfixable)", body)
self.assertIn("* redis:7 [cache]: 4 total (0 fixable, 4 unfixable)", body)
self.assertIn("* nginx:1.27 [web-worker]: 2/3 (fixable/total)", body)
self.assertIn("* redis:7 [cache]: 0/4 (fixable/total)", body)
self.assertIn("Total: 7 CVE(s) in 2 container(s)", body)
def test_build_missing_body_separates_missing_and_unscanned(self) -> None:
@@ -667,7 +669,7 @@ printf '%s\\n' "$*" >> "$APPRISE_LOG"
self.assertIn("CVE-2026-0001", notification)
self.assertIn("Vulnerability scan: other containers", notification)
self.assertIn("redis:7 [cache]", notification)
self.assertIn("(1 fixable, 0 unfixable)", notification)
self.assertIn("1/1 (fixable/total)", notification)
# The important container must not also appear in the summary.
self.assertNotIn("testphp-php [web]", notification)