test: Add webbrowser patching to TestCoder and fix argument order in test_sanity_check_repo

This commit is contained in:
Paul Gauthier 2024-11-07 11:48:17 -08:00 committed by Paul Gauthier (aider)
parent cf5733b237
commit 2962e51dac
2 changed files with 4 additions and 1 deletions

View file

@ -17,6 +17,8 @@ from aider.utils import GitTemporaryDirectory
class TestCoder(unittest.TestCase):
def setUp(self):
self.GPT35 = Model("gpt-3.5-turbo")
self.webbrowser_patcher = patch("aider.io.webbrowser.open")
self.mock_webbrowser = self.webbrowser_patcher.start()
def test_allowed_to_edit(self):
with GitTemporaryDirectory():

View file

@ -128,7 +128,8 @@ def test_git_index_version_greater_than_2(mock_browser, create_repo, mock_io):
)
mock_io.tool_output.assert_any_call("Or run aider --no-git to proceed without using git.")
mock_io.offer_url.assert_any_call(
"Open documentation url for more info?", urls.git_index_version
urls.git_index_version,
"Open documentation url for more info?",
)