# Path: onix/backend/sql/schema.py
# def set_sqlite_pragma(dbapi_connection, connection_record):
# def _ignore_insert(conn, element, multiparams, params):
# def create_tables(engine):
# 
# Path: onix/backend/sql/dao.py
# class ReportingDAO(_dao.ReportingDAO):
#     def __init__(self, connection):
#     def _filtered_battles(self, month, metagame, min_turns):
#     def get_number_of_battles(self, month, metagame, min_turns=3):
#     def _weighted_players(self, battles, baseline):
#     def get_total_weight(self, month, metagame, baseline=1630., min_turns=3):
#     def _weighted_team_members(self, players, sl_table):
#     def _remove_duplicates(self, team_members):
#     def get_usage_by_species(self, month, metagame, species_lookup,
#                              baseline=1630., min_turns=3):


import pytest
import sqlalchemy as sa
from onix.backend.sql import schema
from onix.backend.sql import dao

    total weight:
        1500 baseline: 1.5
        1501 baseline: 1

    usage counts:
        1500 baseline:
            Articuno - 1
            Camerupt - 0.5
        1501 baseline:
            Articuno - 1
'''


@pytest.fixture()
def species_lookup():
    # Camerupt intentionally omitted
    return {'articuno': 'Articuno',
            'basculin': 'Basculin',
            'basculinbluestriped': 'Basculin',
            'camerupt,cameruptmega': 'Camerupt-Mega'}


@pytest.fixture()
def engine():
    return sa.create_engine('sqlite:///')


@pytest.fixture()
def initialize_db(engine):

# Path: onix/backend/sql/schema.py
# def set_sqlite_pragma(dbapi_connection, connection_record):
# def _ignore_insert(conn, element, multiparams, params):
# def create_tables(engine):
# 
# Path: onix/backend/sql/dao.py
# class ReportingDAO(_dao.ReportingDAO):
#     def __init__(self, connection):
#     def _filtered_battles(self, month, metagame, min_turns):
#     def get_number_of_battles(self, month, metagame, min_turns=3):
#     def _weighted_players(self, battles, baseline):
#     def get_total_weight(self, month, metagame, baseline=1630., min_turns=3):
#     def _weighted_team_members(self, players, sl_table):
#     def _remove_duplicates(self, team_members):
#     def get_usage_by_species(self, month, metagame, species_lookup,
#                              baseline=1630., min_turns=3):


# Path: tests/backend/sql/test_dao.py
import pytest
import sqlalchemy as sa
from onix.backend.sql import schema
from onix.backend.sql import dao


    total weight:
        1500 baseline: 1.5
        1501 baseline: 1

    usage counts:
        1500 baseline:
            Articuno - 1
            Camerupt - 0.5
        1501 baseline:
            Articuno - 1
'''


@pytest.fixture()
def species_lookup():
    # Camerupt intentionally omitted
    return {'articuno': 'Articuno',
            'basculin': 'Basculin',
            'basculinbluestriped': 'Basculin',
            'camerupt,cameruptmega': 'Camerupt-Mega'}


@pytest.fixture()
def engine():
    return sa.create_engine('sqlite:///')


@pytest.fixture()
def initialize_db(engine):

    schema.create_tables(engine)