Skip to content

Commit 0973793

Browse files
aperrin66akorosov
authored andcommitted
add test for cf vocabulary fuzzy search
1 parent c4a781f commit 0973793

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pythesint/tests/test_cf_vocabulary.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import mock.mock as mock
44
import requests
55

6-
from pythesint.cf_vocabulary import CFVocabulary
6+
from pythesint.cf_vocabulary import CFVocabulary, ratio
77

88
class CFVocabularyTest(unittest.TestCase):
99
def test_exception_on_unavailable_remote_file(self):
@@ -34,3 +34,12 @@ def test_fetch_version(self):
3434
voc._fetch_online_data(version='9.1.5')
3535
mock_get.assert_called_with(
3636
'https://sdfghdfghd.nersc.no', params={'version': '9.1.5'})
37+
38+
def test_fuzzy_search(self):
39+
"""Test that _fuzzy_search is called with the altered parameters
40+
"""
41+
vocabulary = CFVocabulary('test')
42+
with mock.patch.object(vocabulary, '_fuzzy_search') as mock_fuzzy_search:
43+
vocabulary.fuzzy_search('foo')
44+
mock_fuzzy_search.assert_called_once_with(
45+
'foo', scorer=ratio, results_limit=10, min_score=90.0)

0 commit comments

Comments
 (0)