mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
added failing test case for diffs of empty repo with new file added
This commit is contained in:
parent
fe44627042
commit
af854182dc
1 changed files with 13 additions and 0 deletions
|
@ -13,6 +13,19 @@ from tests.utils import GitTemporaryDirectory
|
||||||
|
|
||||||
|
|
||||||
class TestRepo(unittest.TestCase):
|
class TestRepo(unittest.TestCase):
|
||||||
|
def test_diffs_empty_repo(self):
|
||||||
|
with GitTemporaryDirectory():
|
||||||
|
repo = git.Repo()
|
||||||
|
fname = Path("foo.txt")
|
||||||
|
fname.touch()
|
||||||
|
|
||||||
|
repo.git.add(str(fname))
|
||||||
|
|
||||||
|
git_repo = GitRepo(InputOutput(), None, ".")
|
||||||
|
diffs = git_repo.get_diffs(False)
|
||||||
|
self.assertNotEqual(diffs, "")
|
||||||
|
self.assertIsNotNone(diffs)
|
||||||
|
|
||||||
@patch("aider.repo.simple_send_with_retries")
|
@patch("aider.repo.simple_send_with_retries")
|
||||||
def test_get_commit_message(self, mock_send):
|
def test_get_commit_message(self, mock_send):
|
||||||
mock_send.return_value = "a good commit message"
|
mock_send.return_value = "a good commit message"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue