mirror of
https://github.com/imarkoff/Marble-shell-theme.git
synced 2025-09-23 03:37:56 -07:00
Covered Theme module with tests
- Extracted `ColorReplacementGenerator`; - Extracted `ColorConverterImpl`; - Added documentation to some classes; - `hex_to_rgba` now supports shorthand hex colors (#fff).
This commit is contained in:
28
tests/utils/theme/test_theme_path_provider.py
Normal file
28
tests/utils/theme/test_theme_path_provider.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import unittest
|
||||
|
||||
from scripts.utils.theme.theme_path_provider import ThemePathProvider
|
||||
|
||||
|
||||
class ThemePathProviderTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.theme_path_provider = ThemePathProvider()
|
||||
|
||||
def test_get_theme_path_with_valid_values_returns_correct_path(self):
|
||||
themes_folder = "/usr/share/themes"
|
||||
color_name = "Marble"
|
||||
theme_mode = "dark"
|
||||
theme_type = "gnome-shell"
|
||||
|
||||
expected_path = f"{themes_folder}/Marble-{color_name}-{theme_mode}/{theme_type}/"
|
||||
actual_path = self.theme_path_provider.get_theme_path(themes_folder, color_name, theme_mode, theme_type)
|
||||
|
||||
assert expected_path == actual_path
|
||||
|
||||
def test_get_theme_path_with_empty_values_raises_exception(self):
|
||||
themes_folder = ""
|
||||
color_name = ""
|
||||
theme_mode = ""
|
||||
theme_type = ""
|
||||
|
||||
with self.assertRaises(ValueError):
|
||||
self.theme_path_provider.get_theme_path(themes_folder, color_name, theme_mode, theme_type)
|
Reference in New Issue
Block a user