init commit

This commit is contained in:
2025-11-03 20:59:30 +03:00
commit e31d778ec4
14 changed files with 286 additions and 0 deletions

35
tests/logger_test.py Normal file
View File

@@ -0,0 +1,35 @@
import unittest
import time
import logging
from logging_telegram_handler import TelegramHandler
class MyTestCase(unittest.TestCase):
def test_something(self):
chat_id = "211945135"
alias = "[TEST logging_telegram_handler]"
logging.basicConfig(level=logging.WARNING)
logger = logging.getLogger(__name__)
telegram_handler = TelegramHandler(chat_id, alias)
telegram_handler.setLevel(logging.WARNING)
logger.addHandler(telegram_handler)
logger.critical("critical")
logger.error("error")
logger.warning("warning")
logger.info("info")
logger.debug("debug")
time.sleep(2)
self.assertEqual(True, True) # add assertion here
if __name__ == '__main__':
unittest.main()