Improve highlight_color tests.
This commit is contained in:
parent
93f2e4b24d
commit
81ff622291
@ -595,16 +595,26 @@ class HighlightColorTests(unittest.TestCase):
|
|||||||
def test_white(self):
|
def test_white(self):
|
||||||
"""Test highlighting white."""
|
"""Test highlighting white."""
|
||||||
col = Color('white')
|
col = Color('white')
|
||||||
c1 = Color(utils.highlight_color(col, 1))
|
self.assertEqual(Color(utils.highlight_color(col, 1)),
|
||||||
c2 = Color(127, 127, 127)
|
Color(127, 127, 127), col)
|
||||||
self.assertEqual(c1, c2)
|
|
||||||
|
|
||||||
def test_black(self):
|
def test_black(self):
|
||||||
"""Test highlighting black."""
|
"""Test highlighting black."""
|
||||||
col = Color('black')
|
col = Color('black')
|
||||||
self.assertEqual(Color(utils.highlight_color(col, 0.5)),
|
self.assertEqual(Color(utils.highlight_color(col, 0.5)),
|
||||||
Color(204, 204, 204))
|
Color(204, 204, 204), col)
|
||||||
|
|
||||||
|
def test_yellow(self):
|
||||||
|
"""Test highlighting yellow."""
|
||||||
|
col = Color('yellow')
|
||||||
|
self.assertEqual(Color(utils.highlight_color(col, 0.5)),
|
||||||
|
Color(170, 170, 0), col)
|
||||||
|
|
||||||
|
def test_darkblue(self):
|
||||||
|
"""Test highlighting darkblue."""
|
||||||
|
col = Color('darkblue')
|
||||||
|
self.assertEqual(Color(utils.highlight_color(col, 0.5)),
|
||||||
|
Color(0, 0, 93), col)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user