From 350ba4574f5b7cecd6a4eb24b9d098b63b0f0bcd Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 9 May 2023 07:35:01 -0700 Subject: [PATCH] Initial commit: Added new files to the git repo: test_utils.py --- test_utils.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test_utils.py diff --git a/test_utils.py b/test_utils.py new file mode 100644 index 000000000..66b0facdf --- /dev/null +++ b/test_utils.py @@ -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()