X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/4a32d3d0331bfb9cfb3be8d7016859e860bf453e..bf31d19cbf28a6ee76ec615e709c6498fbd8e756:/pokedex/tests/test_lookup.py diff --git a/pokedex/tests/test_lookup.py b/pokedex/tests/test_lookup.py index b6bef60..703cde9 100644 --- a/pokedex/tests/test_lookup.py +++ b/pokedex/tests/test_lookup.py @@ -89,3 +89,16 @@ def test_fuzzy_lookup(): top_names = [_.object.name for _ in results[0:2]] assert_true(u'Nidoran♂' in top_names, u'Nidoran♂ is a top result for "Nidoran"') assert_true(u'Nidoran♀' in top_names, u'Nidoran♀ is a top result for "Nidoran"') + +def test_wildcard_lookup(): + tests = [ + (u'pokemon:*meleon', u'Charmeleon'), + (u'item:master*', u'Master Ball'), + (u'ee?ee', u'Eevee'), + ] + + for wildcard, name in tests: + results = pokedex.lookup.lookup(wildcard) + first_result = results[0] + assert_equal(first_result.object.name, name, + u'Wildcards work correctly')