Updated color test

This commit is contained in:
Dimitris Zlatanidis 2023-04-25 11:21:12 +03:00
parent 0db590bfc9
commit 0aa9bc7004

View file

@ -2,21 +2,25 @@ import unittest
from slpkg.configs import Configs
class TestColors(unittest.TestCase):
class TestColors(unittest.TestCase, Configs):
def setUp(self):
colors = Configs.colour
self.color = colors()
super(Configs, self).__init__()
def test_colors(self):
self.assertIn('bold', self.color)
self.assertIn('red', self.color)
self.assertIn('yellow', self.color)
self.assertIn('cyan', self.color)
self.assertIn('green', self.color)
self.assertIn('blue', self.color)
self.assertIn('grey', self.color)
self.assertIn('endc', self.color)
self.assertEqual('\033[32;5m', self.blink)
self.assertIn('\033[1m', self.bold)
self.assertEqual('\x1b[91m', self.red)
self.assertEqual('\033[1m\x1b[91m', self.bred)
self.assertEqual('\x1b[32m', self.green)
self.assertEqual('\033[1m\x1b[32m', self.bgreen)
self.assertEqual('\x1b[93m', self.yellow)
self.assertEqual('\033[1m\x1b[93m', self.byellow)
self.assertEqual('\x1b[96m', self.cyan)
self.assertEqual('\x1b[94m', self.blue)
self.assertEqual('\x1b[38;5;247m', self.grey)
self.assertEqual('\x1b[35m', self.violet)
self.assertEqual('\x1b[0m', self.endc)
if __name__ == '__main__':