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
+18 -1
View File
@@ -5,7 +5,12 @@ from __future__ import annotations
from unittest.mock import AsyncMock
import pytest
from langbot.pkg.vector.vdb import SearchType, VectorDatabase
from langbot.pkg.vector.vdb import (
SearchType,
VectorDatabase,
remember_bounded_mapping,
remember_bounded_set,
)
class TestSearchType:
@@ -29,6 +34,18 @@ class TestSearchType:
assert SearchType('hybrid') == SearchType.HYBRID
def test_runtime_cache_helpers_bound_mapping_and_set():
mapping = {}
values = set()
for index in range(100):
remember_bounded_mapping(mapping, str(index), object(), 8)
remember_bounded_set(values, str(index), 8)
assert len(mapping) == 8
assert len(values) == 8
class TestVectorDatabaseAbstractMethods:
"""Tests for VectorDatabase abstract methods."""