From 4ac2143cc2a23d45b03997bf4f118a04e9c4a595 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 27 May 2023 08:27:45 -0700 Subject: [PATCH] Initialized Coder object with mocked IO and mocked repo, and updated coder.repo instead of coder.root. --- tests/test_coder.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_coder.py b/tests/test_coder.py index e39571645..c6bb655a5 100644 --- a/tests/test_coder.py +++ b/tests/test_coder.py @@ -9,13 +9,13 @@ class TestCoder(unittest.TestCase): mock_io.get_input.return_value = "Please check file1.txt and file2.py" mock_io.confirm_ask.return_value = True + # Initialize the Coder object with the mocked IO and mocked repo + coder = Coder(io=mock_io, openai_api_key="fake_key") + # Mock the git repo mock_repo = MagicMock() mock_repo.git.ls_files.return_value = "file1.txt\nfile2.py" - - # Initialize the Coder object with the mocked IO and mocked repo - coder = Coder(io=mock_io, openai_api_key="fake_key", repo=mock_repo) - coder.root = "/path/to/repo" + coder.repo = mock_repo # Call the check_for_file_mentions method result = coder.check_for_file_mentions("Please check file1.txt and file2.py")