style: format long function signatures in test_main.py

This commit is contained in:
Paul Gauthier (aider) 2024-08-28 11:21:33 -07:00
parent a57d9e55d6
commit f466d96597

View file

@ -100,7 +100,9 @@ class TestMain(TestCase):
@patch("aider.main.os.chdir") @patch("aider.main.os.chdir")
@patch("aider.main.InputOutput") @patch("aider.main.InputOutput")
@patch("pathlib.Path.mkdir") @patch("pathlib.Path.mkdir")
def test_setup_git_home_new_project(self, mock_mkdir, mock_io, mock_chdir, mock_glob, mock_home): def test_setup_git_home_new_project(
self, mock_mkdir, mock_io, mock_chdir, mock_glob, mock_home
):
mock_home.return_value = Path("/home/user") mock_home.return_value = Path("/home/user")
mock_glob.return_value = [Path("/home/user/repo1/.git"), Path("/home/user/repo2/.git")] mock_glob.return_value = [Path("/home/user/repo1/.git"), Path("/home/user/repo2/.git")]
mock_io.return_value.prompt_ask.return_value = "new_project" mock_io.return_value.prompt_ask.return_value = "new_project"
@ -120,7 +122,9 @@ class TestMain(TestCase):
@patch("aider.main.os.chdir") @patch("aider.main.os.chdir")
@patch("aider.main.InputOutput") @patch("aider.main.InputOutput")
@patch("pathlib.Path.mkdir") @patch("pathlib.Path.mkdir")
def test_setup_git_home_no_existing_repos(self, mock_mkdir, mock_io, mock_chdir, mock_glob, mock_home): def test_setup_git_home_no_existing_repos(
self, mock_mkdir, mock_io, mock_chdir, mock_glob, mock_home
):
mock_home.return_value = Path("/home/user") mock_home.return_value = Path("/home/user")
mock_glob.return_value = [] mock_glob.return_value = []
mock_io.return_value.user_input.return_value = "new_project" mock_io.return_value.user_input.return_value = "new_project"
@ -140,7 +144,9 @@ class TestMain(TestCase):
@patch("aider.main.os.chdir") @patch("aider.main.os.chdir")
@patch("aider.main.InputOutput") @patch("aider.main.InputOutput")
@patch("pathlib.Path.mkdir") @patch("pathlib.Path.mkdir")
def test_setup_git_home_directory_creation_error(self, mock_mkdir, mock_io, mock_chdir, mock_glob, mock_home): def test_setup_git_home_directory_creation_error(
self, mock_mkdir, mock_io, mock_chdir, mock_glob, mock_home
):
mock_home.return_value = Path("/home/user") mock_home.return_value = Path("/home/user")
mock_glob.return_value = [] mock_glob.return_value = []
mock_io.return_value.user_input.return_value = "new_project" mock_io.return_value.user_input.return_value = "new_project"
@ -154,7 +160,9 @@ class TestMain(TestCase):
) )
mock_mkdir.assert_called_once_with(parents=True, exist_ok=True) mock_mkdir.assert_called_once_with(parents=True, exist_ok=True)
mock_chdir.assert_not_called() mock_chdir.assert_not_called()
mock_io.return_value.tool_error.assert_called_once_with("Error creating directory: Permission denied") mock_io.return_value.tool_error.assert_called_once_with(
"Error creating directory: Permission denied"
)
self.assertIsNone(result) self.assertIsNone(result)
def test_main_with_git_config_yml(self): def test_main_with_git_config_yml(self):