Commit 1684f33b authored by Bram Schoenmakers's avatar Bram Schoenmakers

Add tests for focus and marked background colors

parent 162cc776
...@@ -24,3 +24,5 @@ project_color = junk ...@@ -24,3 +24,5 @@ project_color = junk
context_color = junk context_color = junk
metadata_color = junk metadata_color = junk
link_color = junk link_color = junk
focus_background_color = junk
marked_background_color = junk
...@@ -154,6 +154,14 @@ class ColorsTest(TopydoTest): ...@@ -154,6 +154,14 @@ class ColorsTest(TopydoTest):
self.assertEqual(color_b, '') self.assertEqual(color_b, '')
self.assertEqual(color_c, '') self.assertEqual(color_c, '')
def test_focus_color(self):
config(p_overrides={('colorscheme', 'focus_background_color'): 'gray'})
self.assertEqual(config().focus_background_color().as_ansi(), '\033[0;37m')
def test_mark_color(self):
config(p_overrides={('colorscheme', 'marked_background_color'): 'blue'})
self.assertEqual(config().marked_background_color().as_ansi(), '\033[0;34m')
def test_empty_color_values(self): def test_empty_color_values(self):
config("test/data/ColorsTest5.conf") config("test/data/ColorsTest5.conf")
project_color = config().project_color().as_ansi(p_decoration='bold') project_color = config().project_color().as_ansi(p_decoration='bold')
......
...@@ -128,6 +128,18 @@ class ConfigTest(TopydoTest): ...@@ -128,6 +128,18 @@ class ConfigTest(TopydoTest):
self.assertEqual(config("test/data/ConfigTest5.conf").link_color().color, 6) self.assertEqual(config("test/data/ConfigTest5.conf").link_color().color, 6)
def test_config24(self): def test_config24(self):
""" No focus background color value. """
self.assertEqual(config("test/data/ConfigTest5.conf").focus_background_color().color, 7)
def test_config25(self):
""" No mark background color value. """
self.assertEqual(config("test/data/ConfigTest5.conf").marked_background_color().color, 4)
def test_config26(self):
self.assertTrue(config("test/data/ConfigTest4.conf").focus_background_color().is_neutral())
self.assertTrue(config("test/data/ConfigTest4.conf").marked_background_color().is_neutral())
def test_config27(self):
""" column_keymap test. """ """ column_keymap test. """
keymap, keystates = config("test/data/ConfigTest6.conf").column_keymap() keymap, keystates = config("test/data/ConfigTest6.conf").column_keymap()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment