Skip to content

Commit

Permalink
update tests for X/Y, OR/AS, and S/M
Browse files Browse the repository at this point in the history
  • Loading branch information
magical committed Apr 21, 2018
1 parent 4b7c5d6 commit 673f984
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 30 deletions.
2 changes: 1 addition & 1 deletion splinext/pokedex/tests/test_compare_pokemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_pokemon_query_parsing(self):
should be no comparing.
"""
res = self.do_request(u'eevee')
self.assertEquals(len(res.tmpl_context.found_pokemon), 8, 'correct name gives right count...')
self.assertEquals(len(res.tmpl_context.found_pokemon), 9, 'correct name gives right count...')
self.assertEquals(res.tmpl_context.found_pokemon[0].pokemon.name, u'Eevee', '...and right name')
self.assert_(res.tmpl_context.found_pokemon[1].pokemon is None, 'other slots are empty')

Expand Down
21 changes: 13 additions & 8 deletions splinext/pokedex/tests/test_move_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def test_name(self):

self.check_search(
dict(name=u'thunder'),
[ u'thunder', u'thunderbolt', u'thunder-wave',
[ u'10-000-000-volt-thunderbolt',
u'thunder', u'thunderbolt', u'thunder-wave',
u'thunder-shock', u'thunder-punch', u'thunder-fang' ],
'no wildcards is treated as substring',
exact=True,
Expand All @@ -91,10 +92,12 @@ def test_type(self):
u"""Checks type searching."""
self.check_search(
dict(type=u'dragon'),
[ u'dual-chop', u'draco-meteor', u'dragon-breath', u'dragon-claw',
u'dragon-dance', u'dragon-pulse', u'dragon-rage', u'dragon-rush',
u'dragon-tail', u'outrage', u'roar-of-time', u'spacial-rend',
u'twister',
[ u'clanging-scales', u'clangorous-soulblaze', u'core-enforcer',
u'devastating-drake--physical', u'devastating-drake--special',
u'dual-chop', u'draco-meteor', u'dragon-breath', u'dragon-claw',
u'dragon-dance', u'dragon-hammer', u'dragon-pulse',
u'dragon-rage', u'dragon-rush', u'dragon-tail', u'outrage',
u'roar-of-time', u'spacial-rend', u'twister',
],
'searching by type',
exact=True,
Expand Down Expand Up @@ -192,7 +195,8 @@ def test_numbers(self):
dict(pp=u'1'),
[u'sketch'],
'searching by PP',
exact=True,
# also returns a bunch of z-moves, as of S/M
#exact=True,
)

self.check_search(
Expand All @@ -204,8 +208,9 @@ def test_numbers(self):

self.check_search(
dict(power=u'130'),
[u'blue-flare', u'bolt-strike', u'draco-meteor', u'high-jump-kick',
u'leaf-storm', u'overheat', u'skull-bash'],
[u'blue-flare', u'bolt-strike', u'burn-up', u'draco-meteor',
u'high-jump-kick', u'fleur-cannon', u'leaf-storm', u'overheat',
u'skull-bash'],
'searching by power',
exact=True,
)
Expand Down
47 changes: 26 additions & 21 deletions splinext/pokedex/tests/test_pokemon_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def check_search(self, criteria, expected, message, exact=False):
results = self.do_search(**criteria).tmpl_context.results

self.assert_(
len(results) < 490,
len(results) < 700,
u"doesn't look like we got every single Pokémon: {0}".format(message)
)

Expand Down Expand Up @@ -95,7 +95,7 @@ def test_name(self):

self.check_search(
dict(name=u'MeOwTh'),
[u'Meowth'],
[u'Meowth', u'Alolan Meowth' ],
'case is ignored',
exact=True,
)
Expand Down Expand Up @@ -245,7 +245,7 @@ def test_evolution_stage(self):
)
self.check_search(
dict(evolution_position=u'only'),
[ u'Ditto', u'Farfetch\'d', u'Latias', u'Mew', u'Tauros' ],
[ u'Ditto', u'Farfetch\u2019d', u'Latias', u'Mew', u'Tauros' ],
u'only evolution',
)

Expand Down Expand Up @@ -409,14 +409,15 @@ def test_type(self):
)
self.check_search(
dict(type_operator=u'exact', type=[u'dragon', u'ground']),
[ u'Flygon', u'Gabite', u'Garchomp', u'Gible', u'Vibrava' ],
[ u'Flygon', u'Gabite', u'Garchomp', u'Gible', u'Vibrava',
u'Mega Garchomp', u'Zygarde', u'10% Zygarde', u'50% Zygarde', u'Complete Zygarde'],
'exact type combo',
exact=True,
)
self.check_search(
dict(type_operator=u'only', type=[u'ice', u'steel']),
[
u'Mawile', u'Registeel', # pure steel
u'Registeel', # pure steel
u'Glaceon', u'Glalie', u'Regice', u'Snorunt', # pure ice
],
'only selected types',
Expand Down Expand Up @@ -541,46 +542,47 @@ def test_range_parsing(self):
)

self.check_search(
dict(id=u'648+'),
[ u'Pirouette Meloetta', u'Aria Meloetta', u'Genesect' ],
dict(id=u'806+'),
[ u'Blacephalon', u'Zeraora' ],
'range: n+',
exact=True,
)
self.check_search(
dict(id=u'648-'),
[ u'Pirouette Meloetta', u'Aria Meloetta', u'Genesect' ],
dict(id=u'806-'),
[ u'Blacephalon', u'Zeraora' ],
'range: n-',
exact=True,
)
self.check_search(
dict(id=u'>=648'),
[ u'Pirouette Meloetta', u'Aria Meloetta', u'Genesect' ],
dict(id=u'>=806'),
[ u'Blacephalon', u'Zeraora' ],
'range: >=n',
exact=True,
)

self.check_search(
dict(id=u'+3'),
[ u'Bulbasaur', u'Ivysaur', u'Venusaur' ],
[ u'Bulbasaur', u'Ivysaur', u'Venusaur', u'Mega Venusaur' ],
'range: +m',
exact=True,
)
self.check_search(
dict(id=u'–3'),
[ u'Bulbasaur', u'Ivysaur', u'Venusaur' ],
[ u'Bulbasaur', u'Ivysaur', u'Venusaur', u'Mega Venusaur' ],
'range: endash-m',
exact=True,
)
self.check_search(
dict(id=u'<4'),
[ u'Bulbasaur', u'Ivysaur', u'Venusaur' ],
[ u'Bulbasaur', u'Ivysaur', u'Venusaur', u'Mega Venusaur' ],
'range: <m',
exact=True,
)

self.check_search(
dict(id=u'5~1'),
[ u'Charmander', u'Charmeleon', u'Charizard' ],
[ u'Charmander', u'Charmeleon', u'Charizard',
u'Mega Charizard X', u'Mega Charizard Y' ],
'range: n~m',
exact=True,
)
Expand All @@ -592,7 +594,7 @@ def test_range_parsing(self):
)
self.check_search(
dict(id=u'~9'),
[ u'Wartortle', u'Blastoise', u'Caterpie' ],
[ u'Wartortle', u'Blastoise', u'Mega Blastoise', u'Caterpie' ],
'range: ~m',
exact=True,
)
Expand All @@ -607,7 +609,9 @@ def test_stats(self):
)
self.check_search(
dict(stat_special_attack=u'130-131'),
[ u'Espeon', u'Gengar', u'Glaceon', u'Heatran', u'Latios', u'Magnezone', u'Kyurem' ],
[ u'Espeon', u'Gengar', u'Glaceon', u'Heatran', u'Latios', u'Magnezone', u'Kyurem',
u'Mega Charizard X', u'Mega Slowbro', u'Mega Blaziken', u'Xerneas', u'Yveltal', u'Volcanion', u'Tapu Lele', u'Magearna', u'Original Magearna',
],
'special attack of 130',
exact=True,
)
Expand All @@ -616,7 +620,7 @@ def test_effort(self):
"""Check that searching by effort works correctly."""
self.check_search(
dict(effort_special_attack=u'2', effort_special_defense=u'1'),
[ u'Butterfree', u'Togekiss', u'Venusaur' ],
[ u'Butterfree', u'Togekiss', u'Venusaur', u'Mega Venusaur' ],
'effort',
exact=True,
)
Expand All @@ -625,7 +629,7 @@ def test_hatch_counter(self):
"""Checks searching by initial hatch counter."""
self.check_search(
dict(hatch_counter=u'5'),
[ u'Gyarados', u'Magikarp' ],
[ u'Gyarados', u'Magikarp', u'Mega Gyarados' ],
'hatch counter',
exact=True,
)
Expand All @@ -642,8 +646,8 @@ def test_base_experience(self):
def test_capture_rate(self):
"""Checks searching by capture rate."""
self.check_search(
dict(capture_rate=u'5'),
[ u'Groudon', u'Kyogre' ],
dict(capture_rate=u'205'),
[ u'Corphish' ],
'capture rate',
exact=True,
)
Expand All @@ -655,6 +659,7 @@ def test_base_happiness(self):
[
u'Azelf', u'Blissey', u'Chansey', u'Clefable', u'Clefairy',
u'Cleffa', u'Happiny', u'Lopunny', u'Mesprit', u'Uxie',
u'Mega Lopunny',
],
'base happiness',
exact=True,
Expand Down

0 comments on commit 673f984

Please sign in to comment.