File size: 1,831 Bytes
a7d7463 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | """Tests for thanking module"""
import pytest
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))
from ui.thanking import (
ThankYou,
Appreciation,
CreditDisplay,
quick_thank,
show_custom_appreciation,
)
class TestThankYou:
"""Test ThankYou class"""
def test_show_method_exists(self):
assert hasattr(ThankYou, "show")
def test_show_animation_method_exists(self):
assert hasattr(ThankYou, "show_animation")
def test_thank_messages_not_empty(self):
assert len(ThankYou.THANK_MESSAGES) > 0
class TestAppreciation:
"""Test Appreciation class"""
def test_show_method_exists(self):
assert hasattr(Appreciation, "show")
def test_show_banner_method_exists(self):
assert hasattr(Appreciation, "show_banner")
def test_appreciation_messages_not_empty(self):
assert len(Appreciation.APPRECIATION_MESSAGES) > 0
class TestCreditDisplay:
"""Test CreditDisplay class"""
def test_show_method_exists(self):
assert hasattr(CreditDisplay, "show")
def test_show_simple_method_exists(self):
assert hasattr(CreditDisplay, "show_simple")
def test_credits_structure(self):
assert "core_developer" in CreditDisplay.CREDITS
assert "technologies" in CreditDisplay.CREDITS
def test_core_developer_info(self):
core = CreditDisplay.CREDITS["core_developer"]
assert "name" in core
assert "role" in core
class TestThankingFunctions:
"""Test additional thanking functions"""
def test_quick_thank_exists(self):
assert callable(quick_thank)
def test_show_custom_appreciation_exists(self):
assert callable(show_custom_appreciation)
if __name__ == "__main__":
pytest.main([__file__, "-v"])
|