diff --git a/tests/test_coder.py b/tests/test_coder.py index cfc45db20..4125ee373 100644 --- a/tests/test_coder.py +++ b/tests/test_coder.py @@ -22,7 +22,7 @@ class TestCoder(unittest.TestCase): mock_io = MagicMock() # Initialize the Coder object with the mocked IO and mocked repo - coder = Coder(io=mock_io, openai_api_key="fake_key") + coder = Coder.create(main_model=models.GPT4, io=mock_io, openai_api_key="fake_key") # Mock the git repo mock_repo = MagicMock() @@ -41,7 +41,7 @@ class TestCoder(unittest.TestCase): mock_io = MagicMock() # Initialize the Coder object with the mocked IO and mocked repo - coder = Coder(io=mock_io, openai_api_key="fake_key") + coder = Coder.create(main_model=models.GPT4, io=mock_io, openai_api_key="fake_key") # Mock the git repo mock_repo = MagicMock() @@ -60,7 +60,7 @@ class TestCoder(unittest.TestCase): mock_io = MagicMock() # Initialize the Coder object with the mocked IO and mocked repo - coder = Coder(io=mock_io, openai_api_key="fake_key") + coder = Coder.create(main_model=models.GPT4, io=mock_io, openai_api_key="fake_key") # Mock the git repo mock_repo = MagicMock() @@ -77,7 +77,7 @@ class TestCoder(unittest.TestCase): mock_io = MagicMock() # Initialize the Coder object with the mocked IO and mocked repo - coder = Coder(io=mock_io, openai_api_key="fake_key") + coder = Coder.create(main_model=models.GPT4, io=mock_io, openai_api_key="fake_key") # Mock the send method to return a tuple with a message and False coder.send = MagicMock(return_value=("a good commit message", False)) @@ -93,7 +93,7 @@ class TestCoder(unittest.TestCase): mock_io = MagicMock() # Initialize the Coder object with the mocked IO and mocked repo - coder = Coder(io=mock_io, openai_api_key="fake_key") + coder = Coder.create(main_model=models.GPT4, io=mock_io, openai_api_key="fake_key") # Mock the send method to return a tuple with a message and False coder.send = MagicMock(return_value=('"a good commit message"', False)) @@ -109,7 +109,7 @@ class TestCoder(unittest.TestCase): mock_io = MagicMock() # Initialize the Coder object with the mocked IO and mocked repo - coder = Coder(io=mock_io, openai_api_key="fake_key") + coder = Coder.create(main_model=models.GPT4, io=mock_io, openai_api_key="fake_key") # Mock the send method to return a tuple with a message and False coder.send = MagicMock(return_value=('a good "commit message"', False)) @@ -127,7 +127,7 @@ class TestCoder(unittest.TestCase): mock_io = MagicMock() # Initialize the Coder object with the mocked IO and mocked repo - coder = Coder(io=mock_io, openai_api_key="fake_key") + coder = Coder.create(main_model=models.GPT4, io=mock_io, openai_api_key="fake_key") # Set up the mock to raise RateLimitError on # the first call and return None on the second call @@ -149,7 +149,7 @@ class TestCoder(unittest.TestCase): mock_io = MagicMock() # Initialize the Coder object with the mocked IO and mocked repo - coder = Coder(io=mock_io, openai_api_key="fake_key") + coder = Coder.create(main_model=models.GPT4, io=mock_io, openai_api_key="fake_key") # Set up the mock to raise ConnectionError on the first call # and return None on the second call