mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 23:05:00 +00:00
style: Run linter
This commit is contained in:
parent
a59ebd1913
commit
0a01a5ca2f
1 changed files with 10 additions and 8 deletions
|
@ -424,14 +424,15 @@ class TestRepoMapAllLanguages(unittest.TestCase):
|
||||||
# close the open cache files, so Windows won't error
|
# close the open cache files, so Windows won't error
|
||||||
del repo_map
|
del repo_map
|
||||||
|
|
||||||
|
|
||||||
def test_repo_map_sample_code_base(self):
|
def test_repo_map_sample_code_base(self):
|
||||||
# Path to the sample code base
|
# Path to the sample code base
|
||||||
sample_code_base = Path(__file__).parent.parent / "fixtures" / "sample-code-base"
|
sample_code_base = Path(__file__).parent.parent / "fixtures" / "sample-code-base"
|
||||||
|
|
||||||
# Path to the expected repo map file
|
# Path to the expected repo map file
|
||||||
expected_map_file = Path(__file__).parent.parent / "fixtures" / "sample-code-base-repo-map.txt"
|
expected_map_file = (
|
||||||
|
Path(__file__).parent.parent / "fixtures" / "sample-code-base-repo-map.txt"
|
||||||
|
)
|
||||||
|
|
||||||
# Ensure the paths exist
|
# Ensure the paths exist
|
||||||
self.assertTrue(sample_code_base.exists(), "Sample code base directory not found")
|
self.assertTrue(sample_code_base.exists(), "Sample code base directory not found")
|
||||||
self.assertTrue(expected_map_file.exists(), "Expected repo map file not found")
|
self.assertTrue(expected_map_file.exists(), "Expected repo map file not found")
|
||||||
|
@ -441,22 +442,23 @@ class TestRepoMapAllLanguages(unittest.TestCase):
|
||||||
repo_map = RepoMap(main_model=self.GPT35, root=str(sample_code_base), io=io)
|
repo_map = RepoMap(main_model=self.GPT35, root=str(sample_code_base), io=io)
|
||||||
|
|
||||||
# Get all files in the sample code base
|
# Get all files in the sample code base
|
||||||
other_files = [str(f) for f in sample_code_base.rglob('*') if f.is_file()]
|
other_files = [str(f) for f in sample_code_base.rglob("*") if f.is_file()]
|
||||||
|
|
||||||
# Generate the repo map
|
# Generate the repo map
|
||||||
generated_map = repo_map.get_repo_map([], other_files)
|
generated_map = repo_map.get_repo_map([], other_files)
|
||||||
|
|
||||||
# Convert the generated map to a string representation
|
# Convert the generated map to a string representation
|
||||||
generated_map_str = '\n'.join(f"{k}: {v}" for k, v in sorted(generated_map.items()))
|
generated_map_str = "\n".join(f"{k}: {v}" for k, v in sorted(generated_map.items()))
|
||||||
|
|
||||||
# Write the generated map to the file
|
# Write the generated map to the file
|
||||||
with open(expected_map_file, 'w') as f:
|
with open(expected_map_file, "w") as f:
|
||||||
f.write(generated_map_str)
|
f.write(generated_map_str)
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
del repo_map
|
del repo_map
|
||||||
|
|
||||||
self.fail("Written generated map to file. Please review and update the test.")
|
self.fail("Written generated map to file. Please review and update the test.")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue