WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit d3202ae

Browse files
update test cases
1 parent c6bcbc0 commit d3202ae

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

code/tests/functional/tests/functions/advanced_image_processing/test_advanced_image_processing.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,9 @@ def test_image_passed_to_llm_to_generate_caption(
198198
),
199199
)[0]
200200

201-
# The URL should be a direct URL (not base64) for http/https URLs to save tokens
201+
# The URL should be converted to base64 data URL
202202
image_url = request.get_json()["messages"][1]["content"][1]["image_url"]["url"]
203-
expected_url_prefix = f"{app_config.get('AZURE_STORAGE_ACCOUNT_ENDPOINT')}{app_config.get_from_json('AZURE_BLOB_STORAGE_INFO','containerName')}/{FILE_NAME}"
204-
assert image_url.startswith(expected_url_prefix), f"Expected direct URL starting with {expected_url_prefix}, got {image_url[:100]}"
203+
assert image_url.startswith("data:image/"), f"Expected base64 data URL, got {image_url[:100]}"
205204

206205

207206
def test_embeddings_generated_for_caption(

code/tests/utilities/helpers/test_push_embedder.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,9 @@ def test_embed_file_advanced_image_processing_uses_vision_model_for_captioning(
229229
assert messages[1]["content"][0]["type"] == "text"
230230
assert "Describe this image in detail" in messages[1]["content"][0]["text"]
231231
assert messages[1]["content"][1]["type"] == "image_url"
232-
# Direct URL should be used (not base64) for http/https URLs to save tokens
233-
assert messages[1]["content"][1]["image_url"]["url"] == source_url
232+
# Image should be converted to base64 data URL
233+
image_url = messages[1]["content"][1]["image_url"]["url"]
234+
assert image_url.startswith("data:image/"), f"Expected base64 data URL, got {image_url[:100]}"
234235

235236

236237
def test_embed_file_advanced_image_processing_stores_embeddings_in_search_index(

0 commit comments

Comments
 (0)