0.8.2 fix chalk behavior
This commit is contained in:
parent
9471fc338f
commit
305f193f93
5 changed files with 53 additions and 3 deletions
27
tests/test_color.py
Normal file
27
tests/test_color.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
|
||||
|
||||
import unittest
|
||||
from suou import chalk
|
||||
|
||||
class TestColor(unittest.TestCase):
|
||||
def setUp(self) -> None:
|
||||
...
|
||||
def tearDown(self) -> None:
|
||||
...
|
||||
|
||||
def test_chalk_colors(self):
|
||||
strg = "The quick brown fox jumps over the lazy dog"
|
||||
|
||||
self.assertEqual(f'\x1b[31m{strg}\x1b[39m', chalk.red(strg))
|
||||
self.assertEqual(f'\x1b[32m{strg}\x1b[39m', chalk.green(strg))
|
||||
self.assertEqual(f'\x1b[34m{strg}\x1b[39m', chalk.blue(strg))
|
||||
self.assertEqual(f'\x1b[36m{strg}\x1b[39m', chalk.cyan(strg))
|
||||
self.assertEqual(f'\x1b[33m{strg}\x1b[39m', chalk.yellow(strg))
|
||||
self.assertEqual(f'\x1b[35m{strg}\x1b[39m', chalk.purple(strg))
|
||||
|
||||
def test_chalk_bold(self):
|
||||
strg = "The quick brown fox jumps over the lazy dog"
|
||||
self.assertEqual(f'\x1b[1m{strg}\x1b[22m', chalk.bold(strg))
|
||||
self.assertEqual(f'\x1b[2m{strg}\x1b[22m', chalk.faint(strg))
|
||||
self.assertEqual(f'\x1b[1m\x1b[33m{strg}\x1b[39m\x1b[22m', chalk.bold.yellow(strg))
|
||||
Loading…
Add table
Add a link
Reference in a new issue