<commit_before># encoding: utf8
from nose.tools import *
import unittest

from pokedex.lookup import PokedexLookup

lookup = None

def setup():
    # Recreate data
    global lookup
    lookup = PokedexLookup()
    lookup.rebuild_index()

def test_exact_lookup():
    tests = [
        # Simple lookups
        (u'Eevee',          'pokemon',      133),
        (u'Scratch',        'moves',        10),
        (u'Master Ball',    'items',        1),
        (u'normal',         'types',        1),
        (u'Run Away',       'abilities',    50),

        # Funny characters
        (u'Mr. Mime',       'pokemon',      122),
        (u"Farfetch'd",     'pokemon',      83),
        (u'Poké Ball',      'items',        4),

        # Forms
        (u'Rotom',          'pokemon',      479),
        (u'Wash Rotom',     'pokemon_forms',10059),
        (u'East Shellos',   'pokemon_forms',10039),
<commit_msg>Don't recreate the lookup index in tests<commit_after># encoding: utf8
from nose.tools import *
import unittest

from pokedex.lookup import PokedexLookup

lookup = None

def setup():
    # Recreate data
    global lookup
    lookup = PokedexLookup()

def test_exact_lookup():
    tests = [
        # Simple lookups
        (u'Eevee',          'pokemon',      133),
        (u'Scratch',        'moves',        10),
        (u'Master Ball',    'items',        1),
        (u'normal',         'types',        1),
        (u'Run Away',       'abilities',    50),

        # Funny characters
        (u'Mr. Mime',       'pokemon',      122),
        (u"Farfetch'd",     'pokemon',      83),
        (u'Poké Ball',      'items',        4),

        # Forms
        (u'Rotom',          'pokemon',      479),
        (u'Wash Rotom',     'pokemon_forms',10059),
        (u'East Shellos',   'pokemon_forms',10039),

{'fraction_non_alphanumeric': 0.14033149171270717, 'fraction_numerical': 0.032044198895027624, 'mean_word_length': 1.7151424287856072, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1755187', 'n_tokens_mistral': 641, 'n_tokens_neox': 592, 'n_words': 141}