| Total Complexity | 2 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | """This module is to test the theme switcher plugin.""" |
||
| 8 | class TestThemeSwitcherEditThemeCommand(TestCase): |
||
| 9 | """Test class wrapper using unittest.""" |
||
| 10 | |||
| 11 | # pylint: disable=W0703; This is acceptable since we are testing it not failing |
||
| 12 | |||
| 13 | def test_single_theme(self): |
||
| 14 | """Changing the theme should effect the settings.""" |
||
| 15 | win = sublime.active_window() |
||
| 16 | |||
| 17 | future_skin = "Lachgummi Joghurt" |
||
| 18 | win.run_command( |
||
| 19 | "edit_theme", |
||
| 20 | { |
||
| 21 | "theme": future_skin |
||
| 22 | } |
||
| 23 | ) |
||
| 24 | |||
| 25 | settings = sublime.load_settings("Rainmeter.sublime-settings") |
||
| 26 | post_theme = settings.get("color_scheme", None) |
||
| 27 | |||
| 28 | self.assertTrue(future_skin in post_theme) |
||
| 29 | |||
| 30 | def test_multi_theme(self): |
||
| 31 | """Changing to a non existing theme does not effect the settings.""" |
||
| 32 | win = sublime.active_window() |
||
| 33 | |||
| 34 | settings = sublime.load_settings("Rainmeter.sublime-settings") |
||
| 35 | prior_theme = settings.get("color_scheme", None) |
||
| 36 | |||
| 37 | win.run_command( |
||
| 38 | "edit_theme", |
||
| 39 | { |
||
| 40 | "theme": "Not existing skin" |
||
| 41 | } |
||
| 42 | ) |
||
| 43 | |||
| 44 | settings = sublime.load_settings("Rainmeter.sublime-settings") |
||
| 45 | post_theme = settings.get("color_scheme", None) |
||
| 46 | |||
| 47 | self.assertEqual(prior_theme, post_theme) |
||
| 48 |