<commit_before># -*- coding: utf-8 -*-
"""
Created on Tue Aug  9 14:04:13 2016

@author: sebastian
"""
import os
import unittest

import intelmq.bin.intelmq_gen_harm_docs as gen_harm_docs


class TestGenHarmDocs(unittest.TestCase):
    """
    A TestCase for intelmq_psql_initdb.
    """

    def test_output(self):
        """ Compare output to cached one. """
        with open(os.path.join(os.path.dirname(__file__),
                               '../../../docs/Harmonization-fields.md')) as handle:
            expected = handle.read()
        self.assertEqual(gen_harm_docs.main().strip(), expected.strip())


if __name__ == '__main__':  # pragma: no cover
    unittest.main()<commit_msg>TST: better error message for gen_harm_docs fail<commit_after># -*- coding: utf-8 -*-
"""
Created on Tue Aug  9 14:04:13 2016

@author: sebastian
"""
import os
import unittest

import intelmq.bin.intelmq_gen_harm_docs as gen_harm_docs


class TestGenHarmDocs(unittest.TestCase):
    """
    A TestCase for intelmq_psql_initdb.
    """

    def test_output(self):
        """ Compare output to cached one. """
        with open(os.path.join(os.path.dirname(__file__),
                               '../../../docs/Harmonization-fields.md')) as handle:
            expected = handle.read()
        self.assertEqual(gen_harm_docs.main().strip(), expected.strip(),
                         "docs/Harmonization-fields.md does not match the output of "
                         "intelmq/bin/intelmq_gen_harm_docs.py. Please execute the latter"
                         " and replace the contents of the documentation file.")


if __name__ == '__main__':  # pragma: no cover
    unittest.main()
{'fraction_non_alphanumeric': 0.12611540749553837, 'fraction_numerical': 0.014277215942891136, 'mean_word_length': 2.460905349794239, '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': '4924895', 'n_tokens_mistral': 538, 'n_tokens_neox': 506, 'n_words': 123}