Skip to content
Open
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
6 changes: 3 additions & 3 deletions backend/tests/unit/test_translation_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,20 +540,20 @@ def test_transcribe_imports_should_persist_translation(self):

# Read transcribe module source to verify import
transcribe_path = os.path.join(os.path.dirname(__file__), '..', '..', 'routers', 'transcribe.py')
with open(transcribe_path) as f:
with open(transcribe_path, encoding='utf-8') as f:
source = f.read()
assert 'from utils.translation_cache import' in source
assert 'should_persist_translation' in source

def test_coordinator_calls_should_persist_translation(self):
"""Guard must exist in translation_coordinator.py (moved from transcribe.py in #6155)."""
coordinator_path = os.path.join(os.path.dirname(__file__), '..', '..', 'utils', 'translation_coordinator.py')
with open(coordinator_path) as f:
with open(coordinator_path, encoding='utf-8') as f:
source = f.read()
assert 'should_persist_translation(' in source, "should_persist_translation guard must exist in coordinator"
# Verify transcribe.py uses the coordinator
transcribe_path = os.path.join(os.path.dirname(__file__), '..', '..', 'routers', 'transcribe.py')
with open(transcribe_path) as f:
with open(transcribe_path, encoding='utf-8') as f:
tsource = f.read()
assert 'TranslationCoordinator' in tsource, "transcribe.py must use TranslationCoordinator"

Expand Down
Loading