<commit_before>from twisted.trial import unittest

from better_od import OrderedDict


class TestOrderedDict(unittest.TestCase):
    def setUp(self):
        self._test_keys = ['a', 'b', 'c']
        self._test_vals = [-2, 0, 1]
        self.d = OrderedDict(zip(self._test_keys, self._test_vals))

    def test_OrderedDict_order(self):
        self.assertEquals(self.d.keys(), [key for key in self._test_keys])

    def test_OrderedDict_index(self):
        self.assertEquals(self.d.key_index('c'), 2)

    def test_OrderedDict_reorder(self):
        new_order = ['c', 'a', 'b']
        self.d.reorder_keys(new_order)
        self.assertEquals(self.d.keys(), new_order)


class TestOrderedDictEquality(unittest.TestCase):
    def setUp(self):
        self._test_keys = ['a', 'b', 'c']
        self._test_vals = [-2, 0, 1]
        self.d = OrderedDict(zip(self._test_keys, self._test_vals))

    def test_order_check(self):
        bod = OrderedDict([('c', 1), ('b', 0), ('a', -2)])
        self.assertNotEquals(self.d, bod)

    def test_value_check(self):
        bod = OrderedDict([('a', -2), ('b', 0), ('c', 3)])
        self.assertNotEquals(self.d, bod)

    def test_builtin_dict_inequality(self):
        d = {'a': -2, 'b': 0, 'c': 3}
        self.assertNotEquals(self.d, d)
<commit_msg>Rename test methods to remove redundancy.<commit_after>from twisted.trial import unittest

from better_od import OrderedDict


class TestOrderedDict(unittest.TestCase):
    def setUp(self):
        self._test_keys = ['a', 'b', 'c']
        self._test_vals = [-2, 0, 1]
        self.d = OrderedDict(zip(self._test_keys, self._test_vals))

    def test_order(self):
        self.assertEquals(self.d.keys(), [key for key in self._test_keys])

    def test_index(self):
        self.assertEquals(self.d.key_index('c'), 2)

    def test_reorder(self):
        new_order = ['c', 'a', 'b']
        self.d.reorder_keys(new_order)
        self.assertEquals(self.d.keys(), new_order)


class TestOrderedDictEquality(unittest.TestCase):
    def setUp(self):
        self._test_keys = ['<KEY>']
        self._test_vals = [-2, 0, 1]
        self.d = OrderedDict(zip(self._test_keys, self._test_vals))

    def test_order_check(self):
        bod = OrderedDict([('c', 1), ('b', 0), ('a', -2)])
        self.assertNotEquals(self.d, bod)

    def test_value_check(self):
        bod = OrderedDict([('a', -2), ('b', 0), ('c', 3)])
        self.assertNotEquals(self.d, bod)

    def test_builtin_dict_inequality(self):
        d = {'a': -2, 'b': 0, 'c': 3}
        self.assertNotEquals(self.d, d)

{'fraction_non_alphanumeric': 0.16368584758942456, 'fraction_numerical': 0.012441679626749611, 'mean_word_length': 3.02660406885759, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '4089656', 'n_tokens_mistral': 947, 'n_tokens_neox': 906, 'n_words': 187}