@@ -28,7 +28,8 @@ def test_single_report(self):
2828 self .assertEqual ("3.5.2-r1" , finding1 .component_version )
2929 self .assertEqual ("Upgrade to version: 3.5.4-r0" , finding1 .mitigation )
3030 self .assertEqual ("https://avd.aquasec.com/nvd/cve-2025-9232" , finding1 .references )
31- self .assertEqual ("test/Deployment/test-app" , finding1 .service )
31+ self .assertIsNone (finding1 .service )
32+ self .assertIn ("**Service:** test/Deployment/test-app" , finding1 .description )
3233 self .assertTrue (finding1 .active )
3334 self .assertTrue (finding1 .verified )
3435 self .assertTrue (finding1 .fix_available )
@@ -47,7 +48,8 @@ def test_single_report(self):
4748 self .assertEqual ("v1.24.4" , finding2 .component_version )
4849 self .assertEqual ("Upgrade to version: 1.23.12, 1.24.6" , finding2 .mitigation )
4950 self .assertEqual ("https://avd.aquasec.com/nvd/cve-2025-47907" , finding2 .references )
50- self .assertEqual ("test/Deployment/test-app" , finding2 .service )
51+ self .assertIsNone (finding2 .service )
52+ self .assertIn ("**Service:** test/Deployment/test-app" , finding2 .description )
5153 self .assertTrue (finding2 .active )
5254 self .assertTrue (finding2 .verified )
5355 self .assertTrue (finding2 .fix_available )
@@ -63,7 +65,8 @@ def test_single_report(self):
6365 self .assertEqual ("N/A" , finding3 .component_version )
6466 self .assertEqual ("Upgrade to version: Configure proper security headers" , finding3 .mitigation )
6567 self .assertEqual ("https://www.cisecurity.org/benchmark/docker" , finding3 .references )
66- self .assertEqual ("test/Deployment/test-app" , finding3 .service )
68+ self .assertIsNone (finding3 .service )
69+ self .assertIn ("**Service:** test/Deployment/test-app" , finding3 .description )
6770 self .assertTrue (finding3 .active )
6871 self .assertTrue (finding3 .verified )
6972 self .assertTrue (finding3 .fix_available )
@@ -80,8 +83,11 @@ def test_list_format(self):
8083 findings = parser .get_findings (test_file , Test ())
8184 self .assertEqual (len (findings ), 3 )
8285
83- # Verify findings from different reports have different services
84- services = {finding .service for finding in findings }
86+ # Verify findings from different reports have different service contexts in descriptions
87+ services = {
88+ finding .description .split ("**Service:** " )[1 ].split ("\n " , 1 )[0 ]
89+ for finding in findings if "**Service:** " in finding .description
90+ }
8591 self .assertEqual (len (services ), 2 )
8692 self .assertIn ("test/Deployment/app1" , services )
8793 self .assertIn ("test/Deployment/app2" , services )
0 commit comments