feat(cloud): harden multi-tenant runtime resources

This commit is contained in:
Junyan Qin
2026-07-29 11:32:26 +08:00
parent 32abbb636f
commit ae85ac2b16
211 changed files with 14963 additions and 1968 deletions
+17
View File
@@ -10,11 +10,28 @@ import pytest
import base64
from langbot.pkg.utils.image import (
decode_base64_limited,
encode_base64,
get_qq_image_downloadable_url,
extract_b64_and_format,
)
@pytest.mark.asyncio
async def test_base64_media_helpers_round_trip_within_limit():
encoded = await encode_base64(b'1234')
assert await decode_base64_limited(encoded, max_bytes=4) == b'1234'
@pytest.mark.asyncio
async def test_base64_media_decode_rejects_oversized_payload():
encoded = base64.b64encode(b'12345').decode()
with pytest.raises(ValueError, match='exceeds'):
await decode_base64_limited(encoded, max_bytes=4)
class TestGetQQImageDownloadableUrl:
"""Tests for get_qq_image_downloadable_url function."""