| Total Complexity | 2 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | import sublime |
||
| 6 | class TestThemeSwitcher(TestCase): |
||
| 7 | """Test class wrapper using unittest.""" |
||
| 8 | |||
| 9 | # pylint: disable=W0703; This is acceptable since we are testing it not failing |
||
| 10 | |||
| 11 | def test_edit_theme_command_single_theme(self): |
||
| 12 | """Should run through.""" |
||
| 13 | win = sublime.active_window() |
||
| 14 | |||
| 15 | future_skin = "Lachgummi Joghurt" |
||
| 16 | win.run_command( |
||
| 17 | "edit_theme", |
||
| 18 | { |
||
| 19 | "theme": future_skin |
||
| 20 | } |
||
| 21 | ) |
||
| 22 | |||
| 23 | settings = sublime.load_settings("Rainmeter.sublime-settings") |
||
| 24 | post_theme = settings.get("color_scheme", None) |
||
| 25 | |||
| 26 | self.assertTrue(future_skin in post_theme) |
||
| 27 | |||
| 28 | def test_edit_theme_command_multi_theme(self): |
||
| 29 | win = sublime.active_window() |
||
| 30 | |||
| 31 | settings = sublime.load_settings("Rainmeter.sublime-settings") |
||
| 32 | prior_theme = settings.get("color_scheme", None) |
||
| 33 | |||
| 34 | win.run_command( |
||
| 35 | "edit_theme", |
||
| 36 | { |
||
| 37 | "theme": "Not existing skin" |
||
| 38 | } |
||
| 39 | ) |
||
| 40 | |||
| 41 | settings = sublime.load_settings("Rainmeter.sublime-settings") |
||
| 42 | post_theme = settings.get("color_scheme", None) |
||
| 43 | |||
| 44 | self.assertEqual(prior_theme, post_theme) |
||
| 45 |