-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[run] | ||
source = link | ||
|
||
[report] | ||
omit = */version.py | ||
exclude_lines = | ||
pragma: no cover | ||
except ImportError: | ||
if __name__ == '__main__': | ||
if PY2: | ||
if PY3: | ||
raise NotImplementedError | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: python | ||
python: | ||
- "2.7" | ||
- "3.4" | ||
- "3.5" | ||
install: | ||
- pip install coveralls | ||
- python setup.py install | ||
script: | ||
- coverage run setup.py test | ||
after_success: | ||
- coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# -*- coding: utf-8 -*- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from b3j0f.utils.ut import UTCase | ||
from unittest import main | ||
|
||
from link.fulltext.filter import FulltextMatch | ||
|
||
|
||
class TestMatcher(UTCase): | ||
def test_query(self): | ||
fm = FulltextMatch('a:(foo OR bar) b:(foo OR bar)') | ||
|
||
docs = [ | ||
{'a': 'foo', 'b': 'foo'}, | ||
{'a': 'foo', 'b': 'bar'}, | ||
{'a': 'bar', 'b': 'foo'}, | ||
{'a': 'bar', 'b': 'bar'} | ||
] | ||
|
||
for doc in docs: | ||
self.assertTrue(fm(doc)) | ||
|
||
docs = [ | ||
{'a': 'foo'}, | ||
{'b': 'bar'}, | ||
{'c': 'baz'} | ||
] | ||
|
||
for doc in docs: | ||
self.assertFalse(fm({'a': 'foo'})) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[tox] | ||
envlist=py27,py30,py31,py34,cpython | ||
|
||
[testenv] | ||
commands=python setup.py test | ||
usedevelop=True | ||
recreate=True |