From 81ff6222912bcaf617a7e258843984ce9349bc97 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 15 Jul 2014 11:18:56 +0200 Subject: [PATCH] Improve highlight_color tests. --- qutebrowser/test/utils/test_misc.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/qutebrowser/test/utils/test_misc.py b/qutebrowser/test/utils/test_misc.py index 888a4ca86..14ec85e7e 100644 --- a/qutebrowser/test/utils/test_misc.py +++ b/qutebrowser/test/utils/test_misc.py @@ -595,16 +595,26 @@ class HighlightColorTests(unittest.TestCase): def test_white(self): """Test highlighting white.""" col = Color('white') - c1 = Color(utils.highlight_color(col, 1)) - c2 = Color(127, 127, 127) - self.assertEqual(c1, c2) + self.assertEqual(Color(utils.highlight_color(col, 1)), + Color(127, 127, 127), col) def test_black(self): """Test highlighting black.""" col = Color('black') 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__':