<commit_before>import unittest
import re
from app.util.decorators import empty_arguments

@empty_arguments(Exception)
def _function_with_arg(text, text2):
    return True


class decorationsTest(unittest.TestCase):
    """Docstring for decorationsTest. """
    def setUp(self):
        """ decorators: setup
        """
        pass

    def tearDown(self):
        pass

    def test_empty_arguments(self):
        """decorations: empty_arguments,  Check if args of functions are empty, not kwargs
        :returns: TODO
        """
        # True
        self.assertTrue(_function_with_arg('bla', "bla"))
        # Raiss error on empty argument
        with self.assertRaises(Exception) as e:
            _function_with_arg('bla', '')
        error = str(e.exception)
        print(error)
        regex = re.search("^Error in '_function_with_arg': One of the given arguments .*\'bla', ''\)' are empty\.$", error)
        assert regex is not None
if __name__ == '__main__':
    unittest.main()<commit_msg>Improve test_decorators<commit_after>import unittest
import re
from app.util.decorators import empty_arguments

@empty_arguments(Exception)
def _function_with_arg(text, text2):
    return True


class decorationsTest(unittest.TestCase):
    """Docstring for decorationsTest. """
    def setUp(self):
        """ decorators: setup
        """
        pass

    def tearDown(self):
        pass

    def test_empty_arguments(self):
        """decorations: empty_arguments,  Check if args of functions are empty, not kwargs
        :returns: TODO
        """
        # True
        self.assertTrue(_function_with_arg('bla', "bla"))
        # Raiss error on empty argument
        with self.assertRaises(Exception) as e:
            _function_with_arg('bla', '')
        error = str(e.exception)
        pat ="^Error in '_function_with_arg': One of the given arguments .*\'bla', ''\)' are empty\.$"
        regex = re.search(pat, error)
        assert regex is not None, "'{e}' should be: ^Error in '_function_with_arg': One of the given arguments .*\'bla', ''\)' are empty\.$".format(e=pat)
if __name__ == '__main__':
    unittest.main()
{'fraction_non_alphanumeric': 0.11822429906542056, 'fraction_numerical': 0.0009345794392523365, 'mean_word_length': 2.8507194244604315, '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': '1657755', 'n_tokens_mistral': 633, 'n_tokens_neox': 616, 'n_words': 175}