Skip to content

Commit

Permalink
added extra test and fixed dexnum issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AoifeHughes authored and phinate committed Jun 23, 2023
1 parent e8a7ce2 commit 32d2015
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion tests/test_battles.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async def test_battle_eevee_pikachu_pokes():
async def test_battle_mewtwo_obliterates_eevee():
p = pokefactory.PokeFactory()
eevee = p.make_pokemon(133, moves=["tackle", "growl"], level=5)
mewtwo = p.make_pokemon(151, moves=["psychic"], level=100)
mewtwo = p.make_pokemon(150, moves=["psychic"], level=100)
team1 = Team([eevee])
team2 = Team([mewtwo])
teams = [team1, team2]
Expand All @@ -50,3 +50,32 @@ async def test_battle_mewtwo_obliterates_eevee():
mewtwo_wins = res[0][1]
eevee_wins = res[0][0]
assert mewtwo_wins > eevee_wins


@pytest.mark.asyncio()
async def test_battle_eevee_pikachu_formats():
p = pokefactory.PokeFactory()
eevee = p.make_pokemon(133, moves=["tackle", "growl"], level=5)
pikachu = p.make_pokemon(25, moves=["thundershock", "growl"], level=5)
team1 = Team([eevee])
team2 = Team([pikachu])
teams = [team1, team2]
matches = [[0, 1]]
counter = iter(range(10, 20))
battle_formats = [
"gen4anythinggoes",
"gen6anythinggoes",
"gen7anythinggoes",
"gen8anythinggoes",
]
for battle_format in battle_formats:
player_1 = SimpleHeuristicsPlayer(
PlayerConfiguration(f"Player {next(counter)}", None),
battle_format=battle_format,
)
player_2 = SimpleHeuristicsPlayer(
PlayerConfiguration(f"Player {next(counter)}", None),
battle_format=battle_format,
)
res = await run_battles(matches, teams, player_1, player_2, battles_per_match=1)
assert res is not None

0 comments on commit 32d2015

Please sign in to comment.