27 lines
616 B
Python
27 lines
616 B
Python
#!/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() |