summaryrefslogtreecommitdiff
path: root/tests/test_settings.py
diff options
context:
space:
mode:
authortanaka takashi <isazaka@gmail.com>2026-06-28 14:47:26 +0900
committertanaka takashi <isazaka@gmail.com>2026-06-28 14:47:26 +0900
commit9e430700cc58adbed5baf110961c08cbcb6a7135 (patch)
treee23126ed0636e5d09c92dfeaa98d3228b0bfc03a /tests/test_settings.py
parent967bbca9829ce65edec7a945a571f91e4998a8be (diff)
システムプロンプトへローカルタイムの現在時刻を注入するように変更
Diffstat (limited to 'tests/test_settings.py')
-rw-r--r--tests/test_settings.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/test_settings.py b/tests/test_settings.py
index 737c8fd..29ec2c1 100644
--- a/tests/test_settings.py
+++ b/tests/test_settings.py
@@ -135,10 +135,16 @@ def test_settings_api_and_page_elements(tmp_path: Path) -> None:
def test_system_prompt_is_localized_and_appended() -> None:
custom = "Always answer briefly."
- assert _compose_system_prompt("en", "") == get_prompt("tool_system", lang="en")
- assert _compose_system_prompt("en", custom) == (
- f"{get_prompt('tool_system', lang='en')}\n\n{custom}"
- )
+ # An empty custom prompt yields only the tool prompt plus the current time line.
+ empty = _compose_system_prompt("en", "")
+ assert empty.startswith(get_prompt("tool_system", lang="en"))
+ assert get_prompt("current_time", lang="en").split("{time}")[0].rstrip() in empty
+
+ # A custom prompt is appended after the tool prompt and current time line.
+ composed = _compose_system_prompt("en", custom)
+ assert composed.startswith(get_prompt("tool_system", lang="en"))
+ assert composed.endswith(custom)
+ assert get_prompt("current_time", lang="en").split("{time}")[0].rstrip() in composed
def test_options_are_forwarded_to_tool_and_final_rounds(monkeypatch: pytest.MonkeyPatch) -> None: