From 0a01a5ca2fc53fccadade498fbee7b2340920216 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 23 Aug 2024 10:01:34 -0700 Subject: [PATCH] style: Run linter --- tests/basic/test_repomap.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/basic/test_repomap.py b/tests/basic/test_repomap.py index 88f141371..75be630be 100644 --- a/tests/basic/test_repomap.py +++ b/tests/basic/test_repomap.py @@ -424,14 +424,15 @@ class TestRepoMapAllLanguages(unittest.TestCase): # close the open cache files, so Windows won't error del repo_map - def test_repo_map_sample_code_base(self): # Path to the sample code base sample_code_base = Path(__file__).parent.parent / "fixtures" / "sample-code-base" - + # 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 self.assertTrue(sample_code_base.exists(), "Sample code base directory 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) # 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 generated_map = repo_map.get_repo_map([], other_files) # 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 - with open(expected_map_file, 'w') as f: + with open(expected_map_file, "w") as f: f.write(generated_map_str) - + # Clean up del repo_map self.fail("Written generated map to file. Please review and update the test.") + if __name__ == "__main__": unittest.main()