Initial commit: Added new files to the git repo: test_utils.py

This commit is contained in:
Paul Gauthier 2023-05-09 07:35:01 -07:00
parent 106b72ad70
commit 350ba4574f

15
test_utils.py Normal file
View file

@ -0,0 +1,15 @@
import unittest
from utils import replace_most_similar_chunk
class TestUtils(unittest.TestCase):
def test_replace_most_similar_chunk(self):
whole = "This is a sample text.\nAnother line of text.\nYet another line."
part = "sample text"
replace = "replaced text"
expected_output = "This is a replaced text.\nAnother line of text.\nYet another line."
result = replace_most_similar_chunk(whole, part, replace)
self.assertEqual(result, expected_output)
if __name__ == "__main__":
unittest.main()