Fixes and improvements.

This commit is contained in:
OK
2025-08-09 00:16:37 +02:00
parent 38f0479d1e
commit d742ab86fa
22 changed files with 529 additions and 457 deletions
+6 -5
View File
@@ -1,5 +1,5 @@
import unittest
from unittest.mock import Mock, patch
from unittest.mock import patch
from fjerkroa_bot import bot_logging
@@ -10,9 +10,10 @@ class TestMainEntry(unittest.TestCase):
def test_main_module_exists(self):
"""Test that the main module exists and is executable."""
import os
main_file = "fjerkroa_bot/__main__.py"
self.assertTrue(os.path.exists(main_file))
# Read the content to verify it calls main
with open(main_file) as f:
content = f.read()
@@ -27,7 +28,7 @@ class TestBotLogging(unittest.TestCase):
def test_setup_logging_default(self, mock_basic_config):
"""Test setup_logging with default level."""
bot_logging.setup_logging()
mock_basic_config.assert_called_once()
call_args = mock_basic_config.call_args
self.assertIn("level", call_args.kwargs)
@@ -41,7 +42,7 @@ class TestBotLogging(unittest.TestCase):
def test_setup_logging_calls_basicConfig(self, mock_basic_config):
"""Test that setup_logging calls basicConfig."""
bot_logging.setup_logging()
mock_basic_config.assert_called_once()
# Verify it sets up logging properly
call_args = mock_basic_config.call_args
@@ -50,4 +51,4 @@ class TestBotLogging(unittest.TestCase):
if __name__ == "__main__":
unittest.main()
unittest.main()