init testing

This commit is contained in:
Paul Gauthier 2023-05-11 17:11:22 -07:00
parent ea05c00bd1
commit 6dd586c753
2 changed files with 8 additions and 3 deletions

View file

@ -22,3 +22,4 @@ tqdm==4.65.0
urllib3==2.0.2
wcwidth==0.2.6
yarl==1.9.2
pytest==7.3.1

View file

@ -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()