<commit_before>import sys, os
sys.path.insert(0, os.path.abspath('..'))

import unittest
from mockingbird import Mockingbird
from mockingbird.exceptions import MissingSpec


class MockingbirdExceptionsSuite(unittest.TestCase):

    def setUp(self):
        self.mockingbird = Mockingbird()

    def test_missing_spec_attr(self):
        mockingbird = self.mockingbird

        self.assertRaises(MissingSpec, getattr, mockingbird, 'Phantom')
        self.assertRaises(AttributeError, getattr, mockingbird, 'Phantom')

    def test_missing_spec_key(self):
        mockingbird = self.mockingbird

        self.assertRaises(MissingSpec, mockingbird.get('Phantom'))
        self.assertRaises(KeyError, mockingbird.get('Phantom'))

if __name__ == '__main__':
    unittest.main()<commit_msg>more fixes for py26 tests<commit_after>import sys, os
sys.path.insert(0, os.path.abspath('..'))

import unittest
from mockingbird import Mockingbird
from mockingbird.exceptions import MissingSpec


class MockingbirdExceptionsSuite(unittest.TestCase):

    def setUp(self):
        self.mockingbird = Mockingbird()

    def test_missing_spec_attr(self):
        mockingbird = self.mockingbird

        self.assertRaises(MissingSpec, getattr, mockingbird, 'Phantom')
        self.assertRaises(AttributeError, getattr, mockingbird, 'Phantom')

    def test_missing_spec_key(self):
        mockingbird = self.mockingbird

        self.assertRaises(MissingSpec, mockingbird.__getitem__, 'Phantom')
        self.assertRaises(KeyError, mockingbird.__getitem__, 'Phantom')

if __name__ == '__main__':
    unittest.main()
{'fraction_non_alphanumeric': 0.10025062656641603, 'fraction_numerical': 0.002506265664160401, 'mean_word_length': 4.305647840531561, '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': '6242906', 'n_tokens_mistral': 518, 'n_tokens_neox': 481, 'n_words': 95}