diff --git a/easybuild/tools/output.py b/easybuild/tools/output.py index db2d7426fa..a7284c3600 100644 --- a/easybuild/tools/output.py +++ b/easybuild/tools/output.py @@ -48,13 +48,19 @@ pass +COLOR_BLUE = 'blue' +COLOR_CYAN = 'cyan' COLOR_GREEN = 'green' +COLOR_PURPLE = 'purple' COLOR_RED = 'red' COLOR_YELLOW = 'yellow' # map known colors to ANSII color codes KNOWN_COLORS = { + COLOR_BLUE: '\033[0;34m', + COLOR_CYAN: '\033[0;36m', COLOR_GREEN: '\033[0;32m', + COLOR_PURPLE: '\033[0;35m', COLOR_RED: '\033[0;31m', COLOR_YELLOW: '\033[1;33m', } diff --git a/test/framework/output.py b/test/framework/output.py index d8b43c8c55..71d5715c69 100644 --- a/test/framework/output.py +++ b/test/framework/output.py @@ -130,10 +130,13 @@ def test_colorize(self): Test colorize function """ if HAVE_RICH: - for color in ('green', 'red', 'yellow'): + for color in ('blue', 'cyan', 'green', 'purple', 'red', 'yellow'): self.assertEqual(colorize('test', color), '[bold %s]test[/bold %s]' % (color, color)) else: + self.assertEqual(colorize('test', 'blue'), '\x1b[0;34mtest\x1b[0m') + self.assertEqual(colorize('test', 'cyan'), '\x1b[0;36mtest\x1b[0m') self.assertEqual(colorize('test', 'green'), '\x1b[0;32mtest\x1b[0m') + self.assertEqual(colorize('test', 'purple'), '\x1b[0;35mtest\x1b[0m') self.assertEqual(colorize('test', 'red'), '\x1b[0;31mtest\x1b[0m') self.assertEqual(colorize('test', 'yellow'), '\x1b[1;33mtest\x1b[0m')