File size: 557 Bytes
f582ec6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import unittest
from pathlib import Path

from utils.logging import LoggingLogger


class TestLoggingLogger(unittest.TestCase):
    def setUp(self):
        self.tmp_log_path = Path("./tmp_logging.txt")

    def test_logging_info(self):
        logger = LoggingLogger(filename=self.tmp_log_path,
                               level="INFO").create_instance()
        logger.info("logging information")
        self.assertTrue(self.tmp_log_path.exists())

    def tearDown(self):
        if self.tmp_log_path.exists():
            self.tmp_log_path.unlink()