Resolve uploaded image references for prompt enhancement

This commit is contained in:
Mikei386
2026-09-21 15:03:11 +02:00
parent 5106d0d2ed
commit fd3f3f5979
2 changed files with 15 additions and 1 deletions
+9
View File
@@ -3,6 +3,7 @@ import json
import os
import sys
import threading
import tempfile
import unittest
from pathlib import Path
from unittest.mock import patch
@@ -25,6 +26,14 @@ class CoordinationTests(unittest.TestCase):
with self.assertRaisesRegex(RuntimeError, 'rewritten_prompt'):
router._parse_prompt_enhancer_result('{"wh_ratio":"1:1"}')
def test_image_data_url_resolves_volume_relative_reference(self):
with tempfile.TemporaryDirectory() as directory, \
patch.object(router, 'IMAGE_DIR', directory):
path = Path(directory) / '.edit-reference.ref'
path.write_bytes(b'\x89PNG\r\n\x1a\ncontent')
result = router._image_data_url(path.name)
self.assertTrue(result.startswith('data:image/png;base64,'))
def test_mode_uses_one_consistent_controller_snapshot(self):
with patch.object(router, 'PROFILE_CONTROL_URL', 'http://controller'), \
patch.object(router, '_profile_controller_request', return_value={