예제 #1
0
def test_solo_query():
    names = command.parse_queries('[Gilder Bairn]')
    assert len(names) == 1
    assert names[0] == 'gilder bairn'
    results = command.results_from_queries(names,
                                           whoosh_search.WhooshSearcher())[0]
    assert len(results) == 1
예제 #2
0
def test_split_cards() -> None:
    cards = oracle.load_cards(['Armed // Dangerous'])
    assert len(cards) == 1
    assert image_fetcher.download_image(cards) is not None
    names = command.parse_queries('[Toil // Trouble]', False)
    assert len(names) == 1
    results = command.results_from_queries(names)
    assert len(results) == 1
예제 #3
0
def test_split_cards():
    cards = oracle.cards_from_query('Armed // Dangerous')
    assert len(cards) == 1
    assert image_fetcher.download_image(cards) is not None
    names = command.parse_queries('[Toil // Trouble]')
    assert len(names) == 1
    cards = command.cards_from_queries(names)
    assert len(cards) == 1
예제 #4
0
def test_split_cards():
    cards = oracle.load_cards(['Armed // Dangerous'])
    assert len(cards) == 1
    assert image_fetcher.download_image(cards) is not None
    names = command.parse_queries('[Toil // Trouble]')
    assert len(names) == 1
    results = command.results_from_queries(names,
                                           whoosh_search.WhooshSearcher())[0]
    assert len(results) == 1
예제 #5
0
def test_partial_query() -> None:
    names = command.parse_queries("[Ertai's]", False)
    assert len(names) == 1
    results = command.results_from_queries(names)[0][0]
    assert len(results.get_ambiguous_matches()) == 3
예제 #6
0
def test_legend_query() -> None:
    names = command.parse_queries('[Ertai]', False)
    assert len(names) == 1
    results = command.results_from_queries(names)[0][0]
    assert len(results.get_ambiguous_matches()) == 2
예제 #7
0
def test_double_query() -> None:
    names = command.parse_queries('[Mother of Runes] [Ghostfire]', False)
    assert len(names) == 2
    results = command.results_from_queries(names)
    assert len(results) == 2
예제 #8
0
def test_solo_query() -> None:
    names = command.parse_queries('[Gilder Bairn]', False)
    assert len(names) == 1
    assert names[0] == 'gilder bairn'
    results = command.results_from_queries(names)
    assert len(results) == 1
예제 #9
0
def test_compat() -> None:
    names = command.parse_queries('[[Mother of Runes]]', True)
    assert len(names) == 0
예제 #10
0
def test_partial_query():
    names = command.parse_queries("[Kamahl's]")
    assert len(names) == 1
    cards = command.cards_from_queries(names)
    assert len(cards) == 3
예제 #11
0
def test_legend_query():
    names = command.parse_queries('[Kamahl]')
    assert len(names) == 1
    cards = command.cards_from_queries(names)
    assert len(cards) == 2
예제 #12
0
def test_double_query():
    names = command.parse_queries('[Mother of Runes] [Ghostfire]')
    assert len(names) == 2
    cards = command.cards_from_queries(names)
    assert len(cards) == 2
예제 #13
0
def test_solo_query():
    names = command.parse_queries('[Gilder Bairn]')
    assert len(names) == 1
    assert names[0] == 'gilder bairn'
    cards = command.cards_from_queries(names)
    assert len(cards) == 1
예제 #14
0
def test_partial_query():
    names = command.parse_queries("[Kamahl's]")
    assert len(names) == 1
    results = command.results_from_queries(names,
                                           whoosh_search.WhooshSearcher())[0]
    assert len(results.get_ambiguous_matches()) == 3
예제 #15
0
def test_legend_query():
    names = command.parse_queries('[Kamahl]')
    assert len(names) == 1
    results = command.results_from_queries(names,
                                           whoosh_search.WhooshSearcher())[0]
    assert len(results.get_ambiguous_matches()) == 2
예제 #16
0
def test_double_query():
    names = command.parse_queries('[Mother of Runes] [Ghostfire]')
    assert len(names) == 2
    results = command.results_from_queries(names,
                                           whoosh_search.WhooshSearcher())
    assert len(results) == 2