@@ -87,10 +87,11 @@ def create_temp_vex_file(self, content: dict, filename: str = "test.json") -> st
87
87
json .dump (content , f , indent = 2 )
88
88
return str (file_path )
89
89
90
- @patch ("cve_bin_tool.vex_manager.validate.VEXValidator._get_schema " )
91
- def test_valid_cyclonedx_vex (self , mock_get_schema ):
90
+ @patch ("lib4sbom.validator.SBOMValidator.validate_file " )
91
+ def test_valid_cyclonedx_vex (self , mock_validate_file ):
92
92
"""Test validation of a valid CycloneDX VEX file."""
93
- mock_get_schema .return_value = self .mock_cyclonedx_schema
93
+ # Mock lib4sbom validation to return success
94
+ mock_validate_file .return_value = {"CycloneDX" : True }
94
95
95
96
valid_cyclonedx = {
96
97
"bomFormat" : "CycloneDX" ,
@@ -234,10 +235,11 @@ def test_unknown_format(self):
234
235
self .assertGreaterEqual (len (errors ), 1 )
235
236
self .assertIn ("Could not detect VEX format" , errors [0 ].message )
236
237
237
- @patch ("cve_bin_tool.vex_manager.validate.VEXValidator._get_schema " )
238
- def test_empty_vulnerabilities_warning (self , mock_get_schema ):
238
+ @patch ("lib4sbom.validator.SBOMValidator.validate_file " )
239
+ def test_empty_vulnerabilities_warning (self , mock_validate_file ):
239
240
"""Test that empty vulnerabilities section generates warning."""
240
- mock_get_schema .return_value = self .mock_cyclonedx_schema
241
+ # Mock lib4sbom validation to return success
242
+ mock_validate_file .return_value = {"CycloneDX" : True }
241
243
242
244
cyclonedx_no_vulns = {
243
245
"bomFormat" : "CycloneDX" ,
@@ -417,10 +419,11 @@ def test_version_detection_edge_cases(self):
417
419
# Should fail because bomFormat is case sensitive
418
420
self .assertFalse (is_valid )
419
421
420
- @patch ("cve_bin_tool.vex_manager.validate.VEXValidator._get_schema " )
421
- def test_cyclonedx_version_16 (self , mock_get_schema ):
422
+ @patch ("lib4sbom.validator.SBOMValidator.validate_file " )
423
+ def test_cyclonedx_version_16 (self , mock_validate_file ):
422
424
"""Test validation of CycloneDX 1.6 VEX file."""
423
- mock_get_schema .return_value = self .mock_cyclonedx_16_schema
425
+ # Mock lib4sbom validation to return success
426
+ mock_validate_file .return_value = {"CycloneDX" : True }
424
427
425
428
cyclonedx_16 = {
426
429
"bomFormat" : "CycloneDX" ,
@@ -448,10 +451,11 @@ def test_cyclonedx_version_16(self, mock_get_schema):
448
451
self .assertTrue (is_valid , f"Validation errors: { errors } " )
449
452
self .assertEqual (len (errors ), 0 )
450
453
451
- @patch ("cve_bin_tool.vex_manager.validate.VEXValidator._get_schema " )
452
- def test_cyclonedx_version_15 (self , mock_get_schema ):
454
+ @patch ("lib4sbom.validator.SBOMValidator.validate_file " )
455
+ def test_cyclonedx_version_15 (self , mock_validate_file ):
453
456
"""Test validation of CycloneDX 1.5 VEX file."""
454
- mock_get_schema .return_value = self .mock_cyclonedx_schema
457
+ # Mock lib4sbom validation to return success
458
+ mock_validate_file .return_value = {"CycloneDX" : True }
455
459
456
460
cyclonedx_15 = {
457
461
"bomFormat" : "CycloneDX" ,
0 commit comments