mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 05:59:36 +08:00
Ship folder-based workspaces and data migration, daily practice, redesigned provider and model settings, and streaming conversation improvements. Synchronize README translations and document the archive/permanent-delete upgrade behavior in assets/releases/ver1-6-9.md. Reduce initial JavaScript by deduplicating English resources and loading animation features after hydration. Keep the existing route size budgets. Update regression fixtures and browser audits for scoped URLs and the new settings and learning interfaces.
31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
from deeptutor.services.session.turns.resource_reuse import apply_resource_reuse
|
|
|
|
|
|
def test_one_turn_choices_are_used_without_persisting():
|
|
payload = {
|
|
"knowledge_bases": ["book", "agent"],
|
|
"persona": "tutor",
|
|
"skills": ["math"],
|
|
"mcp": ["search"],
|
|
}
|
|
preferences = dict(payload)
|
|
apply_resource_reuse(
|
|
preferences, {"persona": False, "skills": False, "mcp": False}, ["agent", "unselected"]
|
|
)
|
|
assert preferences == {"knowledge_bases": ["agent"], "persona": "", "skills": [], "mcp": []}
|
|
assert payload["knowledge_bases"] == ["book", "agent"]
|
|
assert payload["skills"] == ["math"]
|
|
|
|
|
|
def test_legacy_and_repeated_choices_stay_unchanged():
|
|
for reuse in (None, {}, {"persona": True, "skills": True, "mcp": True}):
|
|
preferences = {
|
|
"knowledge_bases": ["book"],
|
|
"persona": "tutor",
|
|
"skills": ["math"],
|
|
"mcp": ["search"],
|
|
}
|
|
expected = dict(preferences)
|
|
apply_resource_reuse(preferences, reuse, None)
|
|
assert preferences == expected
|