thanks llms!
This commit is contained in:
1 parent
cd587b9977
commit
beb2f544d9
2 files changed
+54
-15
No files matched your search
+7
-5
@@ -496,15 +496,17 @@ class ReportTests(unittest.TestCase):
|
||||
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(
|
||||
bodies = scan.build_other_containers_bodies(
|
||||
[
|
||||
("nginx:1.27", "web-worker", 3, 2, 1),
|
||||
("redis:7", "cache", 4, 0, 4),
|
||||
]
|
||||
)
|
||||
self.assertIn("- web-worker: 2/3", body)
|
||||
self.assertIn("- cache: 0/4", body)
|
||||
self.assertIn("Total: 7 in 2", body)
|
||||
body = bodies[0]
|
||||
self.assertIn("Other containers with findings", 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:
|
||||
body = scan.build_missing_body(["gone"], ["web"])
|
||||
@@ -668,7 +670,7 @@ printf '%s\\n' "$*" >> "$APPRISE_LOG"
|
||||
self.assertIn("Container: web", notification)
|
||||
self.assertIn("CVE-2026-0001", notification)
|
||||
self.assertIn("Vulnerability scan: other containers", notification)
|
||||
self.assertIn("cache: 1/1", notification)
|
||||
self.assertIn("redis:7 [cache]: 1/1 (fixable/total)", notification)
|
||||
self.assertIn("1/1 (fixable/total)", notification)
|
||||
# The important container must not also appear in the summary.
|
||||
self.assertNotIn("testphp-php [web]", notification)
|
||||
|
||||
Reference in new issue
Block a user