Example #1
0
def test_weighted_search_one_term_eleven_hits(weighted_search_container):
    output = docker_run('search-client-image',
                        '-k',
                        '11',
                        'squid',
                        rm=True,
                        network=('container', weighted_search_container))
    assert text_to_lines(output) == list('jhfgiedakbc')
    assert len(set(text_to_lines(output))) == 11
Example #2
0
def test_weighted_search_one_term_two_hits(weighted_search_container):
    output = docker_run('search-client-image',
                        '-k',
                        '10',
                        'zucchini',
                        rm=True,
                        network=('container', weighted_search_container))
    assert text_to_lines(output)[:2] == ['savory', 'sweet']
    assert len(set(text_to_lines(output))) == 2
Example #3
0
def test_weighted_search_one_term_one_hit(weighted_search_container):
    output = docker_run('search-client-image',
                        '-k',
                        '10',
                        'banana',
                        rm=True,
                        network=('container', weighted_search_container))
    assert text_to_lines(output)[:1] == ['sweet']
    assert len(set(text_to_lines(output))) == 1
Example #4
0
def test_weighted_search_one_term_no_hits(weighted_search_container):
    output = docker_run('search-client-image',
                        '-k',
                        '10',
                        'avocado',
                        rm=True,
                        network=('container', weighted_search_container))
    assert set(text_to_lines(output)).issubset(['sweet', 'savory', 'sour'] +
                                               list('abcdefghijk'))
    assert len(set(text_to_lines(output))) == 0
def test_boolean_search_one_term_eleven_hits(boolean_search_container):
    output = docker_run('search-client-image',
                        '-k',
                        '11',
                        'squid',
                        rm=True,
                        network=('container', boolean_search_container))
    assert sorted(text_to_lines(output)) == sorted('abcdefghijk')
def test_boolean_search_one_term_two_hits(boolean_search_container):
    output = docker_run('search-client-image',
                        '-k',
                        '10',
                        'zucchini',
                        rm=True,
                        network=('container', boolean_search_container))
    assert sorted(text_to_lines(output)) == sorted(['sweet', 'savory'])