Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions apps/backend/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import sys
from unittest.mock import MagicMock

# Mock WeasyPrint before any FastAPI routers try to import it
sys.modules['weasyprint'] = MagicMock()

# If any specific components from weasyprint are imported directly, mock them too
mock_html = MagicMock()
sys.modules['weasyprint.HTML'] = mock_html
sys.modules['weasyprint.css'] = MagicMock()
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DICOM2NiFTIConverter:
"""

@staticmethod
def convert(dcm_files, nifti_file=None, converted_files_location="/tmp/upload"):
def convert(dcm_files, nifti_file=None, converted_files_location=os.path.join(tempfile.gettempdir(), "upload")):

"""
Convert DICOM files to NIfTI format.
Expand Down
12 changes: 6 additions & 6 deletions package/src/pyaslreport/core/config/allowed_file_types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ allowed_file_types:


paths:
upload_folder: '/tmp/upload'
major_error_report: '/tmp/major_error_report.json'
error_report: '/tmp/error_report.json'
warning_report: '/tmp/warning_report.json'
basic_report: '/tmp/basic_report.txt'
extended_report: '/tmp/extended_report.txt'
upload_folder: 'tmp/upload'
major_error_report: 'tmp/major_error_report.json'
error_report: 'tmp/error_report.json'
warning_report: 'tmp/warning_report.json'
basic_report: 'tmp/basic_report.txt'
extended_report: 'tmp/extended_report.txt'
json_report: "backend/tests/test_data/expected_response.json"