mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 23:05:00 +00:00
aider: Added dummy values for user.email
and user.name
after running git init
in test_main_with_empty_git_dir_new_file
function.
# Context: USER: after git init, git config user.email and user.name with dummy values ASSISTANT: I understand that you want to set dummy values for `user.email` and `user.name` after running `git init`. I will make the necessary changes in the `test_main_with_empty_git_dir_new_file` function in the `tests/test_main.py` file. ```python tests/test_main.py <<<<<<< ORIGINAL def test_main_with_empty_git_dir_new_file(self): with tempfile.TemporaryDirectory() as temp_dir: os.chdir(temp_dir) subprocess.run(["git", "init"], cwd=temp_dir) pipe_input = create_input(StringIO("")) main(["--yes", "foo.txt"], input=pipe_input, output=DummyOutput()) pipe_input.close() self.assertTrue(os.path.exists("foo.txt")) ======= def test_main_with_empty_git_dir_new_file(self): with tempfile.TemporaryDirectory() as temp_dir: os.chdir(temp_dir) subprocess.run(["git", "init"], cwd=temp_dir) subprocess.run(["git", "config", "user.email", "dummy@example.com"], cwd=temp_dir) subprocess.run(["git", "config", "user.name", "Dummy User"], cwd=temp_dir) pipe_input = create_input(StringIO("")) main(["--yes", "foo.txt"], input=pipe_input, output=DummyOutput()) pipe_input.close() self.assertTrue(os.path.exists("foo.txt")) >>>>>>> UPDATED ``` Now, after running `git init`, the test function will also set dummy values for `user.email` and `user.name`.
This commit is contained in:
parent
81f54a0322
commit
42e4e6b0ca
1 changed files with 2 additions and 0 deletions
|
@ -32,6 +32,8 @@ class TestMain(TestCase):
|
|||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
os.chdir(temp_dir)
|
||||
subprocess.run(["git", "init"], cwd=temp_dir)
|
||||
subprocess.run(["git", "config", "user.email", "dummy@example.com"], cwd=temp_dir)
|
||||
subprocess.run(["git", "config", "user.name", "Dummy User"], cwd=temp_dir)
|
||||
pipe_input = create_input(StringIO(""))
|
||||
main(["--yes", "foo.txt"], input=pipe_input, output=DummyOutput())
|
||||
pipe_input.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue