Add test ansicolor.
authorRadek Brich <radek.brich@devl.cz>
Wed, 09 Jul 2014 17:56:05 +0200
changeset 14 6caad95d4540
parent 13 b19248829509
child 15 497067ee16b7
Add test ansicolor.
tests/test_ansicolor.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test_ansicolor.py	Wed Jul 09 17:56:05 2014 +0200
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+
+from pycolib.ansicolor import highlight, names
+
+import unittest
+
+
+class TestAnsiColor(unittest.TestCase):
+
+    def test_colors(self):
+        for fg in range(0,8):
+            for bg in range(0,8):
+                print(
+                    highlight(1, fg, bg),
+                    '%10s on %-10s' % (names[fg], names[bg]),
+                    highlight(0),
+                    sep='', end=''
+                )
+            print()
+
+
+if __name__ == '__main__':
+    unittest.main()