Skip to content

Commit 16fd153

Browse files
author
Jacob Mages-Haskins
committed
AIML-77 Fix test setup
1 parent 7b928d0 commit 16fd153

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

test/test_git_handler.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -645,23 +645,17 @@ def test_get_pr_changed_files_count_exception(self, mock_debug_log, mock_get_gh_
645645
self.assertEqual(result, -1)
646646
mock_debug_log.assert_called_with("Error getting changed files count for PR 131415: Network error")
647647

648+
@patch('src.git_handler.config')
648649
@patch('src.git_handler.run_command')
649650
@patch('src.git_handler.get_gh_env')
650651
@patch('src.git_handler.debug_log')
651-
def test_check_issues_enabled_success(self, mock_debug_log, mock_get_gh_env, mock_run_command):
652+
def test_check_issues_enabled_success(self, mock_debug_log, mock_get_gh_env, mock_run_command, mock_config):
652653
"""Test check_issues_enabled when Issues are enabled"""
653-
from src.config import get_config, reset_config
654-
655654
# Setup
655+
mock_config.GITHUB_REPOSITORY = 'mock/repo-for-testing'
656656
mock_get_gh_env.return_value = {'GITHUB_TOKEN': 'mock-token'}
657657
mock_run_command.return_value = "[]" # Empty list indicates success
658658

659-
# Reset config and initialize with testing=True
660-
reset_config()
661-
config = get_config(testing=True)
662-
# Explicitly override the repository setting for this test
663-
config.GITHUB_REPOSITORY = 'mock/repo-for-testing'
664-
665659
# Execute
666660
result = git_handler.check_issues_enabled()
667661

0 commit comments

Comments
 (0)