Files
Marble-shell-theme/tests/utils/theme/test_theme_path_provider.py
Vladyslav Hroshev abfe1f5962 Covered Theme module with tests
- Extracted `ColorReplacementGenerator`;
- Extracted `ColorConverterImpl`;
- Added documentation to some classes;
- `hex_to_rgba` now supports shorthand hex colors (#fff).
2025-04-11 22:53:30 +03:00

28 lines
995 B
Python

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)