mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
style: format long function signatures in test_main.py
This commit is contained in:
parent
a57d9e55d6
commit
f466d96597
1 changed files with 12 additions and 4 deletions
|
@ -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):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue