Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test to show failure case of partial_ratio #217

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -14,7 +14,7 @@ matrix:
- python: "pypy3.5-5.8.0"
env: TEST_SUITE="py.test test_fuzzywuzzy.py test_fuzzywuzzy_pytest.py"
- python: 3.6
env: TEST_SUITE="python setup.py check --restructuredtext --strict --metadata"
env: TEST_SUITE="py.test test_fuzzywuzzy.py test_fuzzywuzzy_pytest.py"
install:
- pip install -U pip setuptools wheel
- pip install pytest==3.2.5 pycodestyle docutils Pygments hypothesis
Expand Down
6 changes: 6 additions & 0 deletions test_fuzzywuzzy.py
Expand Up @@ -92,6 +92,10 @@ def setUp(self):
self.s10 = 'a{'
self.s10a = '{b'

self.s11 = 'thane'
self.s11a = 'nation hospitality honda water thane thane west'
self.s11b = 'nation hospitality honda water thane west'

self.cirque_strings = [
"cirque du soleil - zarkana - las vegas",
"cirque du soleil ",
Expand Down Expand Up @@ -122,6 +126,8 @@ def testCaseInsensitive(self):

def testPartialRatio(self):
self.assertEqual(fuzz.partial_ratio(self.s1, self.s3), 100)
self.assertEqual(fuzz.partial_ratio(self.s11, self.s11a), 100)
self.assertEqual(fuzz.partial_ratio(self.s11, self.s11b), 100)

def testTokenSortRatio(self):
self.assertEqual(fuzz.token_sort_ratio(self.s1, self.s1a), 100)
Expand Down