Veracity_AI/tests/test_main.py

34 lines
924 B
Python

import pytest
import customtkinter
import sys
import os
from unittest.mock import patch
# Add the src directory to the Python path
src_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'src'))
sys.path.insert(0, src_dir)
from main import Main
def test_main_initialization(mocker):
# Mocking the MainFrame and MainFrameController to avoid actual UI creation
mocker.patch('main.MainFrame')
mocker.patch('main.MainFrameController')
# Initialize the Main class
app = Main()
# Check if the title is set correctly
assert app.title() == "Veracity_AI"
# Check if the grid configuration is set correctly
assert app.grid_rowconfigure(0)['weight'] == 1
assert app.grid_columnconfigure(0)['weight'] == 1
# Check if the icon is set correctly
assert app.iconpath is not None
if __name__ == "__main__":
pytest.main([__file__])