Skip to content

Commit a7b51a4

Browse files
authored
Merge pull request #8 from scality/fix-sbom-files-test
🐛 fix 'SBOMFile' object has no attribute 'exists'
2 parents 50c8e88 + ebdd321 commit a7b51a4

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/domain/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ class SBOMFile:
139139

140140
def __post_init__(self) -> None:
141141
"""Validate file exists after initialization."""
142+
# Ensure path is a Path object
143+
if isinstance(self.path, str):
144+
self.path = Path(self.path)
145+
142146
if not self.path.exists():
143147
raise FileNotFoundError(f"SBOM file not found: {self.path}")
144148

src/services/upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def _handle_multiple_sbom_upload(
4747
UploadError: If all uploads fail
4848
"""
4949
results = services.sbom_service.upload_multiple_sboms(
50-
sbom_files, config.project_name, config.project_version
50+
[sbom_file.path for sbom_file in sbom_files], config.project_name, config.project_version
5151
)
5252

5353
successful = sum(1 for result in results if result.success)

0 commit comments

Comments
 (0)