# Path: pokedex/db/tables.py
# class TableSuperclass(object):
# class TableMetaclass(DeclarativeMeta):
# class Language(TableBase):
# class Ability(TableBase):
# class AbilityChangelog(TableBase):
# class AbilityFlavorText(TableBase):
# class Berry(TableBase):
# class BerryFirmness(TableBase):
# class BerryFlavor(TableBase):
# class Characteristic(TableBase):
# class ConquestEpisode(TableBase):
# class ConquestEpisodeWarrior(TableBase):
# class ConquestKingdom(TableBase):
# class ConquestMaxLink(TableBase):
# class ConquestMoveData(TableBase):
# class ConquestMoveDisplacement(TableBase):
# class ConquestMoveEffect(TableBase):
# class ConquestMoveRange(TableBase):
# class ConquestPokemonAbility(TableBase):
# class ConquestPokemonEvolution(TableBase):
# class ConquestPokemonMove(TableBase):
# class ConquestPokemonStat(TableBase):
# class ConquestStat(TableBase):
# class ConquestTransformationPokemon(TableBase):
# class ConquestTransformationWarrior(TableBase):
# class ConquestWarrior(TableBase):
# class ConquestWarriorArchetype(TableBase):
# class ConquestWarriorRank(TableBase):
# class ConquestWarriorRankStatMap(TableBase):
# class ConquestWarriorSkill(TableBase):
# class ConquestWarriorSpecialty(TableBase):
# class ConquestWarriorStat(TableBase):
# class ConquestWarriorTransformation(TableBase):
# class ContestCombo(TableBase):
# class ContestEffect(TableBase):
# class ContestType(TableBase):
# class EggGroup(TableBase):
# class Encounter(TableBase):
# class EncounterCondition(TableBase):
# class EncounterConditionValue(TableBase):
# class EncounterConditionValueMap(TableBase):
# class EncounterMethod(TableBase):
# class EncounterSlot(TableBase):
# class EvolutionChain(TableBase):
# class EvolutionTrigger(TableBase):
# class Experience(TableBase):
# class Gender(TableBase):
# class Generation(TableBase):
# class GrowthRate(TableBase):
# class Item(TableBase):
# class ItemCategory(TableBase):
# class ItemFlag(TableBase):
# class ItemFlagMap(TableBase):
# class ItemFlavorText(TableBase):
# class ItemFlingEffect(TableBase):
# class ItemGameIndex(TableBase):
# class ItemPocket(TableBase):
# class Location(TableBase):
# class LocationArea(TableBase):
# class LocationAreaEncounterRate(TableBase):
# class LocationGameIndex(TableBase):
# class Machine(TableBase):
# class Move(TableBase):
# class MoveBattleStyle(TableBase):
# class MoveChangelog(TableBase):
# class MoveDamageClass(TableBase):
# class MoveEffect(TableBase):
# class MoveEffectChangelog(TableBase):
# class MoveFlag(TableBase):
# class MoveFlagMap(TableBase):
# class MoveFlavorText(TableBase):
# class MoveMeta(TableBase):
# class MoveMetaAilment(TableBase):
# class MoveMetaCategory(TableBase):
# class MoveMetaStatChange(TableBase):
# class MoveTarget(TableBase):
# class Nature(TableBase):
# class NatureBattleStylePreference(TableBase):
# class NaturePokeathlonStat(TableBase):
# class PalPark(TableBase):
# class PalParkArea(TableBase):
# class PokeathlonStat(TableBase):
# class Pokedex(TableBase):
# class PokedexVersionGroup(TableBase):
# class Pokemon(TableBase):
# class PokemonAbility(TableBase):
# class PokemonColor(TableBase):
# class PokemonDexNumber(TableBase):
# class PokemonEggGroup(TableBase):
# class PokemonEvolution(TableBase):
# class PokemonForm(TableBase):
# class PokemonFormGeneration(TableBase):
# class PokemonFormPokeathlonStat(TableBase):
# class PokemonGameIndex(TableBase):
# class PokemonHabitat(TableBase):
# class PokemonItem(TableBase):
# class PokemonMove(TableBase):
# class PokemonMoveMethod(TableBase):
# class PokemonShape(TableBase):
# class PokemonSpecies(TableBase):
# class PokemonSpeciesFlavorText(TableBase):
# class PokemonStat(TableBase):
# class PokemonType(TableBase):
# class Region(TableBase):
# class Stat(TableBase):
# class SuperContestCombo(TableBase):
# class SuperContestEffect(TableBase):
# class Type(TableBase):
# class TypeEfficacy(TableBase):
# class TypeGameIndex(TableBase):
# class Version(TableBase):
# class VersionGroup(TableBase):
# class VersionGroupPokemonMoveMethod(TableBase):
# class VersionGroupRegion(TableBase):
#     def __unicode__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(cls, name, bases, attrs):
#     def star_rating(self):
#     def appears_underground(self):
#     def is_hm(self):
#     def recoil(self):
#     def is_neutral(self):
#     def name(self):
#     def stat(self, stat_identifier):
#     def base_stat(self, stat_identifier, default=0):
#     def better_damage_class(self):
#     def name(self):
# 
# Path: pokedex/db/util.py
# def get(session, table, identifier=None, name=None, id=None, language=None):
# def filter_name(query, table, name, language, name_attribute='name'):
# def order_by_name(query, table, language=None, *extra_languages, **kwargs):


import pytest
from pokedex.db import tables, util
# Encoding: utf8

parametrize = pytest.mark.parametrize


def test_get_item_identifier(session):
    item = util.get(session, tables.Item, identifier=u'master-ball')
    assert item.name == 'Master Ball'

def test_get_item_name(session):
    item = util.get(session, tables.Item, name=u'Awakening')
    assert item.name == 'Awakening'

def test_get_english_by_identifier(session):

# Path: pokedex/db/tables.py
# class TableSuperclass(object):
# class TableMetaclass(DeclarativeMeta):
# class Language(TableBase):
# class Ability(TableBase):
# class AbilityChangelog(TableBase):
# class AbilityFlavorText(TableBase):
# class Berry(TableBase):
# class BerryFirmness(TableBase):
# class BerryFlavor(TableBase):
# class Characteristic(TableBase):
# class ConquestEpisode(TableBase):
# class ConquestEpisodeWarrior(TableBase):
# class ConquestKingdom(TableBase):
# class ConquestMaxLink(TableBase):
# class ConquestMoveData(TableBase):
# class ConquestMoveDisplacement(TableBase):
# class ConquestMoveEffect(TableBase):
# class ConquestMoveRange(TableBase):
# class ConquestPokemonAbility(TableBase):
# class ConquestPokemonEvolution(TableBase):
# class ConquestPokemonMove(TableBase):
# class ConquestPokemonStat(TableBase):
# class ConquestStat(TableBase):
# class ConquestTransformationPokemon(TableBase):
# class ConquestTransformationWarrior(TableBase):
# class ConquestWarrior(TableBase):
# class ConquestWarriorArchetype(TableBase):
# class ConquestWarriorRank(TableBase):
# class ConquestWarriorRankStatMap(TableBase):
# class ConquestWarriorSkill(TableBase):
# class ConquestWarriorSpecialty(TableBase):
# class ConquestWarriorStat(TableBase):
# class ConquestWarriorTransformation(TableBase):
# class ContestCombo(TableBase):
# class ContestEffect(TableBase):
# class ContestType(TableBase):
# class EggGroup(TableBase):
# class Encounter(TableBase):
# class EncounterCondition(TableBase):
# class EncounterConditionValue(TableBase):
# class EncounterConditionValueMap(TableBase):
# class EncounterMethod(TableBase):
# class EncounterSlot(TableBase):
# class EvolutionChain(TableBase):
# class EvolutionTrigger(TableBase):
# class Experience(TableBase):
# class Gender(TableBase):
# class Generation(TableBase):
# class GrowthRate(TableBase):
# class Item(TableBase):
# class ItemCategory(TableBase):
# class ItemFlag(TableBase):
# class ItemFlagMap(TableBase):
# class ItemFlavorText(TableBase):
# class ItemFlingEffect(TableBase):
# class ItemGameIndex(TableBase):
# class ItemPocket(TableBase):
# class Location(TableBase):
# class LocationArea(TableBase):
# class LocationAreaEncounterRate(TableBase):
# class LocationGameIndex(TableBase):
# class Machine(TableBase):
# class Move(TableBase):
# class MoveBattleStyle(TableBase):
# class MoveChangelog(TableBase):
# class MoveDamageClass(TableBase):
# class MoveEffect(TableBase):
# class MoveEffectChangelog(TableBase):
# class MoveFlag(TableBase):
# class MoveFlagMap(TableBase):
# class MoveFlavorText(TableBase):
# class MoveMeta(TableBase):
# class MoveMetaAilment(TableBase):
# class MoveMetaCategory(TableBase):
# class MoveMetaStatChange(TableBase):
# class MoveTarget(TableBase):
# class Nature(TableBase):
# class NatureBattleStylePreference(TableBase):
# class NaturePokeathlonStat(TableBase):
# class PalPark(TableBase):
# class PalParkArea(TableBase):
# class PokeathlonStat(TableBase):
# class Pokedex(TableBase):
# class PokedexVersionGroup(TableBase):
# class Pokemon(TableBase):
# class PokemonAbility(TableBase):
# class PokemonColor(TableBase):
# class PokemonDexNumber(TableBase):
# class PokemonEggGroup(TableBase):
# class PokemonEvolution(TableBase):
# class PokemonForm(TableBase):
# class PokemonFormGeneration(TableBase):
# class PokemonFormPokeathlonStat(TableBase):
# class PokemonGameIndex(TableBase):
# class PokemonHabitat(TableBase):
# class PokemonItem(TableBase):
# class PokemonMove(TableBase):
# class PokemonMoveMethod(TableBase):
# class PokemonShape(TableBase):
# class PokemonSpecies(TableBase):
# class PokemonSpeciesFlavorText(TableBase):
# class PokemonStat(TableBase):
# class PokemonType(TableBase):
# class Region(TableBase):
# class Stat(TableBase):
# class SuperContestCombo(TableBase):
# class SuperContestEffect(TableBase):
# class Type(TableBase):
# class TypeEfficacy(TableBase):
# class TypeGameIndex(TableBase):
# class Version(TableBase):
# class VersionGroup(TableBase):
# class VersionGroupPokemonMoveMethod(TableBase):
# class VersionGroupRegion(TableBase):
#     def __unicode__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(cls, name, bases, attrs):
#     def star_rating(self):
#     def appears_underground(self):
#     def is_hm(self):
#     def recoil(self):
#     def is_neutral(self):
#     def name(self):
#     def stat(self, stat_identifier):
#     def base_stat(self, stat_identifier, default=0):
#     def better_damage_class(self):
#     def name(self):
# 
# Path: pokedex/db/util.py
# def get(session, table, identifier=None, name=None, id=None, language=None):
# def filter_name(query, table, name, language, name_attribute='name'):
# def order_by_name(query, table, language=None, *extra_languages, **kwargs):


# Path: pokedex/tests/test_util.py
import pytest
from pokedex.db import tables, util

# Encoding: utf8

parametrize = pytest.mark.parametrize


def test_get_item_identifier(session):
    item = util.get(session, tables.Item, identifier=u'master-ball')
    assert item.name == 'Master Ball'

def test_get_item_name(session):
    item = util.get(session, tables.Item, name=u'Awakening')
    assert item.name == 'Awakening'

def test_get_english_by_identifier(session):

    language = util.get(session, tables.Language, u'en')