From 6dd586c753139359fb85d8a986b7253b69bb4efd Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 11 May 2023 17:11:22 -0700 Subject: [PATCH] init testing --- requirements.txt | 1 + {aider => tests}/test_utils.py | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) rename {aider => tests}/test_utils.py (89%) diff --git a/requirements.txt b/requirements.txt index c2bbb61bc..47a9a6e08 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,3 +22,4 @@ tqdm==4.65.0 urllib3==2.0.2 wcwidth==0.2.6 yarl==1.9.2 +pytest==7.3.1 diff --git a/aider/test_utils.py b/tests/test_utils.py similarity index 89% rename from aider/test_utils.py rename to tests/test_utils.py index 9414a9864..71b740dba 100644 --- a/aider/test_utils.py +++ b/tests/test_utils.py @@ -1,5 +1,6 @@ import unittest -from utils import replace_most_similar_chunk +from aider.utils import replace_most_similar_chunk, strip_quoted_wrapping + class TestUtils(unittest.TestCase): def test_replace_most_similar_chunk(self): @@ -21,7 +22,9 @@ class TestUtils(unittest.TestCase): self.assertEqual(result, expected_output) def test_strip_quoted_wrapping(self): - input_text = "filename.ext\n```\nWe just want this content\nNot the filename and triple quotes\n```" + input_text = ( + "filename.ext\n```\nWe just want this content\nNot the filename and triple quotes\n```" + ) expected_output = "We just want this content\nNot the filename and triple quotes\n" result = strip_quoted_wrapping(input_text, "filename.ext") self.assertEqual(result, expected_output) @@ -38,5 +41,6 @@ class TestUtils(unittest.TestCase): result = strip_quoted_wrapping(input_text) self.assertEqual(result, expected_output) + if __name__ == "__main__": - unittest.main() \ No newline at end of file + unittest.main()