RapidFuzz/tests/test_utils.py

36 lines
1003 B
Python
Raw Normal View History

2020-08-22 19:07:08 +00:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
2020-05-24 07:57:08 +00:00
import unittest
from rapidfuzz import process, fuzz, utils
class UtilsTest(unittest.TestCase):
def test_fullProcess(self):
mixed_strings = [
"Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
"C'est la vie",
2020-08-22 19:07:08 +00:00
u"Ça va?",
u"Cães danados",
u"¬Camarões assados",
u"a¬ሴ€耀",
u"Á"
2020-05-24 07:57:08 +00:00
]
mixed_strings_proc = [
"lorem ipsum is simply dummy text of the printing and typesetting industry",
"c est la vie",
2020-08-22 19:07:08 +00:00
u"Ça va",
u"cães danados",
u"¬camarões assados",
u"a¬ሴ€耀",
u"Á"
2020-05-24 07:57:08 +00:00
]
for string, proc_string in zip(mixed_strings, mixed_strings_proc):
self.assertEqual(
utils.default_process(string),
proc_string)
if __name__ == '__main__':
unittest.main()