From be72e360207ddff5fc8fd157f2c801b426b6a994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Ccary-server=E2=80=9D?= Date: Fri, 19 Jun 2026 23:02:46 +0800 Subject: [PATCH] test: cover POSIX file URI root preservation --- tests/test_media_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_media_utils.py b/tests/test_media_utils.py index c64d286c5e..72f5bb4f70 100644 --- a/tests/test_media_utils.py +++ b/tests/test_media_utils.py @@ -446,6 +446,12 @@ def test_file_uri_to_path_supports_standard_and_legacy_posix_file_uris(tmp_path) assert media_utils.file_uri_to_path(legacy_file_uri) == str(media_path) +def test_file_uri_to_path_preserves_posix_root_for_container_paths(): + assert media_utils.file_uri_to_path("file:///AstrBot/data/cache/image.png") == ( + "/AstrBot/data/cache/image.png" + ) + + def test_from_file_system_uses_pathlib_file_uri(tmp_path): media_path = tmp_path / "media file.bin" media_path.write_bytes(b"media")