Skip to content

Commit 867ed8a

Browse files
authored
Merge pull request #322 from ppizarror/fix-theme-copy
Color attribute copy
2 parents b4e6465 + b2ff36f commit 867ed8a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/test_themes.py

+14
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,20 @@ def test_copy(self) -> None:
7676
self.assertNotEqual(theme.background_color, theme_copy.background_color)
7777
self.assertNotEqual(theme.background_color, pygame_menu.themes.THEME_DEFAULT.background_color)
7878

79+
# Test attribute copy
80+
color_main = (29, 120, 107, 255)
81+
color_copy = (241, 125, 1)
82+
theme_white = pygame_menu.themes.Theme(
83+
scrollbar_thick=50,
84+
selection_color=color_main
85+
)
86+
87+
sub_theme_white = theme_white.copy()
88+
sub_theme_white.selection_color = color_copy
89+
90+
self.assertEqual(theme_white.selection_color, color_main)
91+
self.assertEqual(sub_theme_white.selection_color, color_copy)
92+
7993
def test_methods(self) -> None:
8094
"""
8195
Test theme method.

0 commit comments

Comments
 (0)