<commit_before>import unittest

from brew.parsers import JSONDataLoader


class TestJSONDataLoader(unittest.TestCase):

    def setUp(self):
        self.parser = JSONDataLoader('./')

    def test_format_name(self):
        name_list = [('pale malt 2-row us', 'pale_malt_2_row_us'),
                     ('caramel crystal malt 20l', 'caramel_crystal_malt_20l'),
                     ('centennial', 'centennial'),
                     ('cascade us', 'cascade_us'),<commit_msg>Add test to DataLoader base class<commit_after>import unittest

from brew.parsers import DataLoader
from brew.parsers import JSONDataLoader


class TestDataLoader(unittest.TestCase):

    def setUp(self):
        self.parser = DataLoader('./')

    def test_read_data_raises(self):
        with self.assertRaises(NotImplementedError):
            self.parser.read_data('filename')


class TestJSONDataLoader(unittest.TestCase):

    def setUp(self):
        self.parser = JSONDataLoader('./')

    def test_format_name(self):
        name_list = [('pale malt 2-row us', 'pale_malt_2_row_us'),
                     ('caramel crystal malt 20l', 'caramel_crystal_malt_20l'),
                     ('centennial', 'centennial'),
                     ('cascade us', 'cascade_us'),
{'fraction_non_alphanumeric': 0.11449159327461969, 'fraction_numerical': 0.009607686148919135, 'mean_word_length': 2.8109756097560976, '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': '4188761', 'n_tokens_mistral': 399, 'n_tokens_neox': 365, 'n_words': 79}