This commit is contained in:
Niklas Peng 2025-05-30 19:51:58 +02:00
parent 4f88f30cbb
commit 02034e881e
2 changed files with 28 additions and 0 deletions

1
tests/__init__.py Normal file
View File

@ -0,0 +1 @@
"""Test package for the codeeditor application."""

27
tests/test_main.py Normal file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the main module."""
import unittest
from unittest.mock import patch
import sys
import io
from src import main
class TestMain(unittest.TestCase):
"""Test cases for the main module."""
@patch('sys.stdout', new_callable=io.StringIO)
def test_main_function(self, mock_stdout):
"""Test the main function."""
main.main()
output = mock_stdout.getvalue()
self.assertIn("Starting codeeditor application", output)
self.assertIn("Application finished", output)
if __name__ == "__main__":
unittest.main()