예제 #1
0
파일: test_wcut.py 프로젝트: kyleam/wcut
def test_match_search_with_complement(animals):
    assert wcut.match_fields(animals, ['otter'], complement=True) == [0]
    assert wcut.match_fields(animals, ['otter', 'seal'], complement=True) == []
예제 #2
0
파일: test_wcut.py 프로젝트: kyleam/wcut
def test_match_with_repeated_fields(animals):
    repeat = animals + animals[-1:]
    assert wcut.match_fields(repeat, animals) == [0, 1, 2]
예제 #3
0
파일: test_wcut.py 프로젝트: kyleam/wcut
def test_match_with_repeated_searches(animals):
    repeat = animals + ['parrot']
    assert wcut.match_fields(animals, repeat) == [0, 1]
예제 #4
0
파일: test_wcut.py 프로젝트: kyleam/wcut
def test_match_wholename(animals):
    partial = [a[:2] for a in animals]
    assert wcut.match_fields(animals, partial, wholename=True) == []
    assert wcut.match_fields(animals, animals, wholename=True) == [0, 1]
예제 #5
0
파일: test_wcut.py 프로젝트: kyleam/wcut
def test_match_partial(animals):
    partial = [a[:2] for a in animals]
    assert wcut.match_fields(animals, partial) == [0, 1]
예제 #6
0
파일: test_wcut.py 프로젝트: kyleam/wcut
def test_match_case_sensitive(animals):
    upper = [a.upper() for a in animals]
    assert wcut.match_fields(upper, animals) == []
    assert wcut.match_fields(upper, animals, ignore_case=True) == [0, 1]
예제 #7
0
파일: test_wcut.py 프로젝트: kyleam/wcut
def test_match_with_empty_field(digits):
    assert wcut.match_fields(digits, ['']) == []
예제 #8
0
파일: test_wcut.py 프로젝트: kyleam/wcut
def test_no_matching_fields(digits, animals):
    assert wcut.match_fields(digits, animals) == []