# Path: onix/contexts.py
# class Context(object):
# class ResourceMissingError(Exception):
#     def __init__(self, **resources):
#     def __init__(self, resource):
# def require(context, *resources):
# def _get_context(commit, force_refresh):
# def get_standard_context(force_refresh=False):
# def get_historical_context(timestamp):
# 
# Path: onix/utilities.py
# def sanitize_string(input_string):
#     def __init__(self, pokedex, aliases):
#     def sanitize(self, input_object):
# def compute_sid(moveset, sanitizer=None):
# def stats_dict_to_model(stats_dict):
# def calculate_stats(base_stats, nature, ivs, evs, level):
# def load_natures():
# def load_accessible_formes():
# def load_species_lookup():
# def parse_ruleset(ruleset):
# def determine_hidden_power_type(ivs):
# class Sanitizer(object):
# 
# Path: onix/model.py
# class PokeStats(namedtuple('PokeStats', ['hp',
#                                          'atk',
#                                          'dfn',
#                                          'spa',
#                                          'spd',
#                                          'spe'])):
#     """
#     Container to represent a Pokemon's stats. This could be base stats, IVs/EVs
#     or battle-stats.
# 
#     Args:
#         hp (int) : hit point stat
#         atk (int) : attack stat
#         dfn (int) : defense stat (you can't have a field named "def")
#         spa (int) : special attack stat
#         spd (int) : special defense stat
#         spe (int) : speed stat
#     """
#     pass
# 
# class Moveset(namedtuple('Moveset', ['formes',
#                                      'gender',
#                                      'item',
#                                      'moves',
#                                      'level',
#                                      'happiness'])):
#     """
#     Container comprising a complete description of a specific build's
#     battle-relevant attributes (read: not nickname).
# 
#     Args:
#         formes (:obj:`list` of :obj:`Forme`) : the formes the Pokemon might
#             take over the course of the battle
# 
#             .. note ::
#                 The first forme in this list is considered the Pokemon's
#                 "primary forme." It is the forme the Pokemon will appear in
#                 the first time it appears on the field (making an exception for
#                 orb-holding Groudon and Kyogre who transform immediately into
#                 their Primal formes and do not change back)
# 
#         gender ('m', 'f' or 'u') : the Pokemon's gender ('u' represents "not
#             specified")
#         item (str) : the Pokemon's held item
#         moves (:obj:`list` of :obj:`str`) : the moves the Pokemon knows
#         level (int) : the Pokemon's level
#         happiness (int) : the Pokemon's happiness
# 
#     Note:
#         Nature, IVs and EVs aren't included in this description, since there
#         might be multiple ways to get to the same battle-stats, but they're all
#         functionally equivalent.
# 
#     """
#     pass
# 
# class Player(namedtuple('Player', ['id',
#                                    'rating'])):
#     """
#     Container for metadata about a given player/alt
# 
#     Args:
#         id (str) : the player's unique ID
#         rating (dict) : dictionary of player ratings (e.g. Elo, W-L record...).
#             The specifics of what's included in this dict will vary based on
#             the context.
#     """
#     pass
# 
# class Forme(namedtuple('Forme', ['species',
#                                  'ability',
#                                  'stats'])):
#     """
#     Container to represent a Pokemon's Forme (that is, the aspects of a moveset
#     that might change when forme changes).
# 
#     Args:
#         species (str) : forme name
#         ability (str) : the Pokemon's ability
#         stats (PokeStats) : the Pokemon's battle stats (that is, not base stats)
#     """
# 
# Path: onix/collection/log_reader.py
# class ParsingError(Exception):
# class LogReader(with_metaclass(abc.ABCMeta, object)):
# class JsonFileLogReader(LogReader):
#     def __init__(self, log_ref, message):
# def get_all_formes(species, ability, item, moves,
#                    context, hackmons=False, any_ability=False):
# def rating_dict_to_model(rating_dict):
# def normalize_hidden_power(moves, ivs):
#     def __init__(self, context):
#     def _parse_log(self, log_ref):
#     def parse_log(self, log_ref):
#     def _parse_moveset(self, moveset_dict, hackmons, any_ability,
#                        mega_rayquaza_allowed, default_level):
#     def __init__(self, context):
#     def _parse_log(self, log_ref):


import datetime
import json
import os
import shutil
import pytest
from onix import contexts
from onix import utilities
from onix.model import PokeStats, Moveset, Player, Forme
from onix.collection import log_reader




class StumpLogReader(log_reader.LogReader):

    def __init__(self, context, metagame):
        super(StumpLogReader,
              self).__init__(context)

        (self.game_type,
         self.hackmons,
         self.any_ability,
         self.mega_rayquaza_allowed,
         self.default_level) = utilities.parse_ruleset(
            context.formats[metagame])

    def _parse_log(self, log_ref):
        pass


@pytest.fixture(scope='class')
def ctx():
    return contexts.get_historical_context(datetime.datetime(2016, 10, 1, 5, 0))


class TestGetAllFormes(object):

    def test_pokemon_with_a_single_forme(self, ctx):


# Path: onix/contexts.py
# class Context(object):
# class ResourceMissingError(Exception):
#     def __init__(self, **resources):
#     def __init__(self, resource):
# def require(context, *resources):
# def _get_context(commit, force_refresh):
# def get_standard_context(force_refresh=False):
# def get_historical_context(timestamp):
# 
# Path: onix/utilities.py
# def sanitize_string(input_string):
#     def __init__(self, pokedex, aliases):
#     def sanitize(self, input_object):
# def compute_sid(moveset, sanitizer=None):
# def stats_dict_to_model(stats_dict):
# def calculate_stats(base_stats, nature, ivs, evs, level):
# def load_natures():
# def load_accessible_formes():
# def load_species_lookup():
# def parse_ruleset(ruleset):
# def determine_hidden_power_type(ivs):
# class Sanitizer(object):
# 
# Path: onix/model.py
# class PokeStats(namedtuple('PokeStats', ['hp',
#                                          'atk',
#                                          'dfn',
#                                          'spa',
#                                          'spd',
#                                          'spe'])):
#     """
#     Container to represent a Pokemon's stats. This could be base stats, IVs/EVs
#     or battle-stats.
# 
#     Args:
#         hp (int) : hit point stat
#         atk (int) : attack stat
#         dfn (int) : defense stat (you can't have a field named "def")
#         spa (int) : special attack stat
#         spd (int) : special defense stat
#         spe (int) : speed stat
#     """
#     pass
# 
# class Moveset(namedtuple('Moveset', ['formes',
#                                      'gender',
#                                      'item',
#                                      'moves',
#                                      'level',
#                                      'happiness'])):
#     """
#     Container comprising a complete description of a specific build's
#     battle-relevant attributes (read: not nickname).
# 
#     Args:
#         formes (:obj:`list` of :obj:`Forme`) : the formes the Pokemon might
#             take over the course of the battle
# 
#             .. note ::
#                 The first forme in this list is considered the Pokemon's
#                 "primary forme." It is the forme the Pokemon will appear in
#                 the first time it appears on the field (making an exception for
#                 orb-holding Groudon and Kyogre who transform immediately into
#                 their Primal formes and do not change back)
# 
#         gender ('m', 'f' or 'u') : the Pokemon's gender ('u' represents "not
#             specified")
#         item (str) : the Pokemon's held item
#         moves (:obj:`list` of :obj:`str`) : the moves the Pokemon knows
#         level (int) : the Pokemon's level
#         happiness (int) : the Pokemon's happiness
# 
#     Note:
#         Nature, IVs and EVs aren't included in this description, since there
#         might be multiple ways to get to the same battle-stats, but they're all
#         functionally equivalent.
# 
#     """
#     pass
# 
# class Player(namedtuple('Player', ['id',
#                                    'rating'])):
#     """
#     Container for metadata about a given player/alt
# 
#     Args:
#         id (str) : the player's unique ID
#         rating (dict) : dictionary of player ratings (e.g. Elo, W-L record...).
#             The specifics of what's included in this dict will vary based on
#             the context.
#     """
#     pass
# 
# class Forme(namedtuple('Forme', ['species',
#                                  'ability',
#                                  'stats'])):
#     """
#     Container to represent a Pokemon's Forme (that is, the aspects of a moveset
#     that might change when forme changes).
# 
#     Args:
#         species (str) : forme name
#         ability (str) : the Pokemon's ability
#         stats (PokeStats) : the Pokemon's battle stats (that is, not base stats)
#     """
# 
# Path: onix/collection/log_reader.py
# class ParsingError(Exception):
# class LogReader(with_metaclass(abc.ABCMeta, object)):
# class JsonFileLogReader(LogReader):
#     def __init__(self, log_ref, message):
# def get_all_formes(species, ability, item, moves,
#                    context, hackmons=False, any_ability=False):
# def rating_dict_to_model(rating_dict):
# def normalize_hidden_power(moves, ivs):
#     def __init__(self, context):
#     def _parse_log(self, log_ref):
#     def parse_log(self, log_ref):
#     def _parse_moveset(self, moveset_dict, hackmons, any_ability,
#                        mega_rayquaza_allowed, default_level):
#     def __init__(self, context):
#     def _parse_log(self, log_ref):


# Path: tests/collection/test_log_reader.py
import datetime
import json
import os
import shutil
import pytest
from onix import contexts
from onix import utilities
from onix.model import PokeStats, Moveset, Player, Forme
from onix.collection import log_reader





class StumpLogReader(log_reader.LogReader):

    def __init__(self, context, metagame):
        super(StumpLogReader,
              self).__init__(context)

        (self.game_type,
         self.hackmons,
         self.any_ability,
         self.mega_rayquaza_allowed,
         self.default_level) = utilities.parse_ruleset(
            context.formats[metagame])

    def _parse_log(self, log_ref):
        pass


@pytest.fixture(scope='class')
def ctx():
    return contexts.get_historical_context(datetime.datetime(2016, 10, 1, 5, 0))


class TestGetAllFormes(object):

    def test_pokemon_with_a_single_forme(self, ctx):


        expected = [Forme('stunfisk', 'static',