Skip to content

Commit d42d88f

Browse files
Copilotnosredna123
andcommitted
Fix test consistency: Use Config mocking pattern throughout tests
Co-authored-by: nosredna123 <[email protected]>
1 parent 21d531c commit d42d88f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/unit/core/test_force_accept_mode.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,7 @@ def test_config_strict_mode_parsing(self):
246246
def reload_config_and_get_strict_mode():
247247
"""Helper to reload config and get BAE_STRICT_MODE value"""
248248
importlib.reload(config)
249-
from config import Config
250-
return Config.BAE_STRICT_MODE
249+
return config.Config.BAE_STRICT_MODE
251250

252251
# Test various true values
253252
for value in ["true", "True", "TRUE", "1", "yes", "on"]:
@@ -261,8 +260,6 @@ def reload_config_and_get_strict_mode():
261260

262261
def test_force_accept_metadata_tracking(self):
263262
"""Test that force-accepted artifacts include proper metadata"""
264-
os.environ["BAE_STRICT_MODE"] = "false"
265-
266263
techlead = TechLeadSWEA()
267264

268265
mock_validation_result = {
@@ -282,8 +279,11 @@ def test_force_accept_metadata_tracking(self):
282279
"retry_count": 3,
283280
}
284281

285-
with patch.object(techlead, '_validate_with_llm', return_value=mock_validation_result):
286-
result = techlead._review_and_approve(payload)
282+
# Mock Config.BAE_STRICT_MODE to False (force-accept mode) and validation method
283+
with patch('baes.swea_agents.techlead_swea.Config.BAE_STRICT_MODE', False):
284+
with patch('baes.swea_agents.techlead_swea.Config.BAE_MAX_RETRIES', 3):
285+
with patch.object(techlead, '_validate_with_llm', return_value=mock_validation_result):
286+
result = techlead._review_and_approve(payload)
287287

288288
# Verify comprehensive metadata
289289
assert result["force_accepted"] == True

0 commit comments

Comments
 (0)