Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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