From 9a283f3f437061795a55f680fa2b456c5ed0c19e Mon Sep 17 00:00:00 2001 From: user Date: Mon, 23 Dec 2024 12:38:38 -0500 Subject: [PATCH] Fix expert unit tests. --- tests/ra_aid/tools/test_expert.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/ra_aid/tools/test_expert.py b/tests/ra_aid/tools/test_expert.py index 7114c69..f7d992c 100644 --- a/tests/ra_aid/tools/test_expert.py +++ b/tests/ra_aid/tools/test_expert.py @@ -86,19 +86,20 @@ def test_read_files_with_limit_encoding_error(temp_test_files): def test_expert_context_management(): """Test expert context global state management.""" # Clear any existing context - expert_context.clear() + expert_context['text'].clear() + expert_context['files'].clear() # Test adding context result1 = emit_expert_context("Test context 1") assert "Context added" in result1 - assert len(expert_context) == 1 - assert expert_context[0] == "Test context 1" + assert len(expert_context['text']) == 1 + assert expert_context['text'][0] == "Test context 1" # Test adding multiple contexts result2 = emit_expert_context("Test context 2") assert "Context added" in result2 - assert len(expert_context) == 2 - assert expert_context[1] == "Test context 2" + assert len(expert_context['text']) == 2 + assert expert_context['text'][1] == "Test context 2" # Test context accumulation - assert all(ctx in expert_context for ctx in ["Test context 1", "Test context 2"]) + assert all(ctx in expert_context['text'] for ctx in ["Test context 1", "Test context 2"])