MCPcopy Create free account
hub / github.com/bcefghj/miniClaudeCode / test_truncation

Method test_truncation

tests/test_agent_loop.py:55–63  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

53 self.assertEqual(msgs[1]["role"], "assistant")
54
55 def test_truncation(self):
56 config = Config(max_context_messages=5)
57 ctx = ConversationContext(config=config)
58 for i in range(10):
59 ctx.add_user_message(f"msg {i}")
60 msgs = ctx.get_api_messages()
61 self.assertLessEqual(len(msgs), 5)
62 # First message should be preserved
63 self.assertEqual(msgs[0]["content"], "msg 0")
64
65 def test_system_prompt(self):
66 ctx = ConversationContext(config=Config())

Callers

nothing calls this directly

Calls 4

add_user_messageMethod · 0.95
get_api_messagesMethod · 0.95
ConfigClass · 0.90
ConversationContextClass · 0.90

Tested by

no test coverage detected