Ejemplo n.º 1
0
    def test_load_pickle(self, _pokemon_pickle_file):
        nosferapti = Pokemon.from_pickle(_pokemon_pickle_file)

        assert nosferapti.code == 56
        assert nosferapti.number == 41
        assert nosferapti.name == "Nosferapti"
        assert nosferapti.level == 5
        assert nosferapti.health == 39
        assert nosferapti.attack == 25
        assert nosferapti.defense == 14
        assert nosferapti.special_attack == 14
        assert nosferapti.special_defense == 19
        assert nosferapti.speed == 24
        assert nosferapti.total == 135
        assert nosferapti.iv == [12, 27, 2, 3, 14, 16]
        assert nosferapti.ev == [0, 0, 0, 0, 0, 0]
        assert nosferapti.accuracy == 1.0
        assert nosferapti.dodge == 1.0
Ejemplo n.º 2
0
def _defender_pokemon() -> Pokemon:
    return Pokemon.from_pickle(CURRENT_DIR / "inputs" / "nosferapti.pkl")
Ejemplo n.º 3
0
    def test_write_read_pickle(self, tmp_path):
        random_salameche = Pokemon.generate_random("Salameche", 37)
        random_salameche.to_pickle(tmp_path / "save.pkl")

        read_salameche = Pokemon.from_pickle(tmp_path / "save.pkl")
        assert read_salameche == random_salameche