<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

__author__ = '<NAME> (張道博)'

import unittest
from msg_logger import MSGLogger
from logging import INFO
from logging import DEBUG
from logging import ERROR


class MSGLoggerTester(unittest.TestCase):

    def setUp(self):
        self.logger = MSGLogger(__name__)

    def testInit(self):
        self.assertIsNotNone(self.logger)

    def testLogRecording(self):
        msg = "Recording test."

        self.logger.startRecording()
        self.logger.log(msg, INFO)
        self.logger.endRecording()
        self.logger.log("This should not be logged.", INFO)

        self.assertEqual(self.logger.recording, msg)
        

if __name__ == '__main__':
    unittest.main()
<commit_msg>adding silent logging test<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

__author__ = '<NAME> (張道博)'

import unittest
from msg_logger import MSGLogger
from logging import INFO
from logging import DEBUG
from logging import ERROR


class MSGLoggerTester(unittest.TestCase):

    def setUp(self):
        self.logger = MSGLogger(__name__)

    def testInit(self):
        self.logger.log('Testing init.')

        self.assertIsNotNone(self.logger)

    def testLogRecording(self):
        self.logger.log('Testing log recording.')

        msg = "Recording test."

        self.logger.startRecording()
        self.logger.log(msg, INFO)
        self.logger.endRecording()
        self.logger.log("This should not be logged.", INFO)

        self.assertEqual(self.logger.recording, msg)

    def testSilentLogging(self):
        self.logger.log('Testing silent logging.')

        msg = "Recording test."

        self.logger.startRecording()
        self.logger.log(msg, 'silent')
        self.logger.endRecording()

        self.assertEqual(self.logger.recording, '')


if __name__ == '__main__':
    unittest.main()

{'fraction_non_alphanumeric': 0.11667554608417688, 'fraction_numerical': 0.0010655301012253596, 'mean_word_length': 2.888198757763975, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1045964', 'n_tokens_mistral': 583, 'n_tokens_neox': 571, 'n_words': 131}