<commit_before>import unittest

import pandas as pd

from multiplate import multiplateIO


class TestIsInstance(unittest.TestCase):

    def test_enspire_csv_parser(self):
        """Check that parsed EnSpire csv matches expected data"""
        input_data = multiplateIO.parse_csv("test_data/EnSpire/raw_plate_data_enspire.csv", "enspire")
        expected_data = pd.read_pickle("test_data/EnSpire/expected_plate_data.pkl")
        for data_set in input_data:
            self.assertTrue(data_set.equals(expected_data))


if __name__ == '__main__':
    unittest.main()<commit_msg>Fixed test data directory variables to support python -m unittest discover calls.<commit_after>import unittest

import os.path
import pandas as pd

from multiplate import multiplateIO

TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "test_data")

class TestIsInstance(unittest.TestCase):

    def test_enspire_csv_parser(self):
        """Check that parsed EnSpire csv matches expected data"""
        test_dir = os.path.join(TEST_DATA_DIR, "EnSpire")
        input_data = multiplateIO.parse_csv(os.path.join(test_dir, "raw_plate_data_enspire.csv"), "enspire")
        expected_data = pd.read_pickle(os.path.join(test_dir, "expected_plate_data.pkl"))
        # input_data is an iterator with one item
        for data_set in input_data:
            self.assertTrue(data_set.equals(expected_data))


if __name__ == '__main__':
    unittest.main()
{'fraction_non_alphanumeric': 0.09344490934449093, 'fraction_numerical': 0.0, 'mean_word_length': 4.218181818181818, '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': '6851883', 'n_tokens_mistral': 471, 'n_tokens_neox': 447, 'n_words': 99}