<commit_before>import os
import battlenet
from operator import itemgetter
from battlenet.utils import client_id
from battlenet.utils import client_secret

try:
    import unittest2 as unittest
except ImportError:
    import unittest as unittest

class DataTest(unittest.TestCase):
    def setUp(self):
        self.connection = battlenet.Connection(client_id=client_id(), client_secret=client_secret())

    def test_races(self):
        races = self.connection.get_character_races(battlenet.UNITED_STATES)

        self.assertEqual({
            1: u'Human',
            2: u'Orc',
            3: u'Dwarf',
            4: u'Night Elf',
            5: u'Undead',
            6: u'Tauren',
            7: u'Gnome',
            8: u'Troll',
            9: u'Goblin',
            10: u'Blood Elf',
            11: u'Draenei',
            22: u'Worgen',
            24: u'Pandaren',
            25: u'Pandaren',
            26: u'Pandaren',
            27: 'Nightborne',
            28: 'Highmountain Tauren',
            29: 'Void Elf',
            30: 'Lightforged Draenei',
            34: 'Dark Iron Dwarf',
            36: "Mag'har Orc",
        }, dict([(race.id, race.name) for race in races]))

        for race in races:
            self.assertIn(race.side, ['alliance', 'horde', 'neutral'])

    def test_classes(self):
        classes = self.connection.get_character_classes(
            battlenet.UNITED_STATES, raw=True)<commit_msg>Better tests for the races.<commit_after>import os
import battlenet
from operator import itemgetter
from battlenet.utils import client_id
from battlenet.utils import client_secret

try:
    import unittest2 as unittest
except ImportError:
    import unittest as unittest

class DataTest(unittest.TestCase):
    def setUp(self):
        self.connection = battlenet.Connection(client_id=client_id(), client_secret=client_secret())

    def test_races(self):
        races = self.connection.get_character_races(battlenet.UNITED_STATES)

        self.assertEqual(battlenet.RACE, dict([(race.id, race.name) for race in races]))

        for race in races:
            self.assertIn(race.side, ['alliance', 'horde', 'neutral'])

    def test_classes(self):
        classes = self.connection.get_character_classes(
            battlenet.UNITED_STATES, raw=True)
{'fraction_non_alphanumeric': 0.10413943355119826, 'fraction_numerical': 0.015250544662309368, 'mean_word_length': 2.521472392638037, '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': '1732906', 'n_tokens_mistral': 740, 'n_tokens_neox': 707, 'n_words': 171}