# Path: onix/reporting/dao.py
# class ReportingDAO(with_metaclass(abc.ABCMeta, object)):
#     def get_usage_by_species(self, month, metagame, species_lookup,
#                              baseline=1630., min_turns=3):
#     def get_number_of_battles(self, month, metagame, min_turns=3):
#     def get_total_weight(self, month, metagame, baseline=1630., min_turns=3):
# 
# Path: onix/reporting/reports.py
# def _species_check(species, unknown_species_handling):
# def generate_usage_stats(reporting_dao, species_lookup, month, metagame,
#                          baseline=1630.0, min_turns=3,
#                          unknown_species_handling='raise'):


import pytest
from onix.reporting import dao
from onix.reporting import reports

@pytest.fixture(scope='module')
def empty_report():
    return ' Total battles: 5000\n'\
           ' Avg. weight / team: 0.000000\n'\
           ' + ---- + ------------------------- + --------- +\n'\
           ' | Rank | Species                   | Usage %   |\n'\
           ' + ---- + ------------------------- + --------- +\n'\
           ' + ---- + ------------------------- + --------- +\n'


class TestGenerateUsageStats(object):

    def setup_method(self, method):
        self.dao = MockReportingDao()

        self.lookup = {'landorustherian': 'Landorus-Therian',
                       'heatran': 'Heatran',
                       'latios': 'Latios',
                       'scizor': 'Scizor',
                       'scizor,scizormega': 'Scizor-Mega',
                       'charizard': 'Charizard',
                       'charizard,charizardmegax': 'Charizard-Mega-X',
                       'charizard,charizardmegay': 'Charizard-Mega-Y',
                       'gastrodon': 'Gastrodon',
                       'gastrodoneast': 'Gastrodon',
                       'quilava': 'Quilava'}

    def test_raise_error_for_unkown_species(self):
        with pytest.raises(KeyError):

# Path: onix/reporting/dao.py
# class ReportingDAO(with_metaclass(abc.ABCMeta, object)):
#     def get_usage_by_species(self, month, metagame, species_lookup,
#                              baseline=1630., min_turns=3):
#     def get_number_of_battles(self, month, metagame, min_turns=3):
#     def get_total_weight(self, month, metagame, baseline=1630., min_turns=3):
# 
# Path: onix/reporting/reports.py
# def _species_check(species, unknown_species_handling):
# def generate_usage_stats(reporting_dao, species_lookup, month, metagame,
#                          baseline=1630.0, min_turns=3,
#                          unknown_species_handling='raise'):


# Path: tests/reporting/test_reports.py
import pytest
from onix.reporting import dao
from onix.reporting import reports


@pytest.fixture(scope='module')
def empty_report():
    return ' Total battles: 5000\n'\
           ' Avg. weight / team: 0.000000\n'\
           ' + ---- + ------------------------- + --------- +\n'\
           ' | Rank | Species                   | Usage %   |\n'\
           ' + ---- + ------------------------- + --------- +\n'\
           ' + ---- + ------------------------- + --------- +\n'


class TestGenerateUsageStats(object):

    def setup_method(self, method):
        self.dao = MockReportingDao()

        self.lookup = {'landorustherian': 'Landorus-Therian',
                       'heatran': 'Heatran',
                       'latios': 'Latios',
                       'scizor': 'Scizor',
                       'scizor,scizormega': 'Scizor-Mega',
                       'charizard': 'Charizard',
                       'charizard,charizardmegax': 'Charizard-Mega-X',
                       'charizard,charizardmegay': 'Charizard-Mega-Y',
                       'gastrodon': 'Gastrodon',
                       'gastrodoneast': 'Gastrodon',
                       'quilava': 'Quilava'}

    def test_raise_error_for_unkown_species(self):
        with pytest.raises(KeyError):

            reports.generate_usage_stats(self.dao,