mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-22 21:34:59 +00:00
init testing
This commit is contained in:
parent
ea05c00bd1
commit
6dd586c753
2 changed files with 8 additions and 3 deletions
|
@ -22,3 +22,4 @@ tqdm==4.65.0
|
||||||
urllib3==2.0.2
|
urllib3==2.0.2
|
||||||
wcwidth==0.2.6
|
wcwidth==0.2.6
|
||||||
yarl==1.9.2
|
yarl==1.9.2
|
||||||
|
pytest==7.3.1
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import unittest
|
import unittest
|
||||||
from utils import replace_most_similar_chunk
|
from aider.utils import replace_most_similar_chunk, strip_quoted_wrapping
|
||||||
|
|
||||||
|
|
||||||
class TestUtils(unittest.TestCase):
|
class TestUtils(unittest.TestCase):
|
||||||
def test_replace_most_similar_chunk(self):
|
def test_replace_most_similar_chunk(self):
|
||||||
|
@ -21,7 +22,9 @@ class TestUtils(unittest.TestCase):
|
||||||
self.assertEqual(result, expected_output)
|
self.assertEqual(result, expected_output)
|
||||||
|
|
||||||
def test_strip_quoted_wrapping(self):
|
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"
|
expected_output = "We just want this content\nNot the filename and triple quotes\n"
|
||||||
result = strip_quoted_wrapping(input_text, "filename.ext")
|
result = strip_quoted_wrapping(input_text, "filename.ext")
|
||||||
self.assertEqual(result, expected_output)
|
self.assertEqual(result, expected_output)
|
||||||
|
@ -38,5 +41,6 @@ class TestUtils(unittest.TestCase):
|
||||||
result = strip_quoted_wrapping(input_text)
|
result = strip_quoted_wrapping(input_text)
|
||||||
self.assertEqual(result, expected_output)
|
self.assertEqual(result, expected_output)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
Loading…
Add table
Add a link
Reference in a new issue