Exemplo n.º 1
0
    def test_write(self):
        engine = LoggerEngine(self.config_dict)
        test_data = 'Test'

        with patch.object(engine, 'logger') as logger:
            engine.write(test_data)
            logger.log.assert_called_with(mock.ANY, "Test")
Exemplo n.º 2
0
    def test_format_data(self):
        engine = LoggerEngine(self.config_dict)
        ascii_str = str('Test')
        unicode_str = engine.format_data(ascii_str)

        self.assertTrue(isinstance(ascii_str, str))
        self.assertTrue(isinstance(unicode_str, unicode))
Exemplo n.º 3
0
    def test_ready(self):
        engine = LoggerEngine(self.config_dict)

        self.assertTrue(engine.ready(True))
Exemplo n.º 4
0
 def test_result_data_exists_on_engine(self):
     engine = LoggerEngine(self.config_dict)
     engine.formatted_data = "Test"
     self.assertEqual(engine.result(True), "Test")