def test_ansi(self):
     assert str(ANSIStyle(fgcolor=Color('reset'))) == '\033[39m'
     assert str(ANSIStyle(fgcolor=Color.from_full('green'))) == '\033[38;5;2m'
     assert str(ANSIStyle(fgcolor=Color.from_simple('red'))) == '\033[31m'
 def test_loading_methods(self):
     assert Color("Yellow") == Color.from_full("Yellow")
     assert (Color.from_full("yellow").representation !=
                         Color.from_simple("yellow").representation)
Пример #3
0
 def test_ansi(self):
     assert str(ANSIStyle(fgcolor=Color("reset"))) == "\033[39m"
     assert str(ANSIStyle(fgcolor=Color.from_full("green"))) == "\033[38;5;2m"
     assert str(ANSIStyle(fgcolor=Color.from_simple("red"))) == "\033[31m"
Пример #4
0
 def test_ansi(self):
     assert str(ANSIStyle(fgcolor=Color("reset"))) == "\033[39m"
     assert str(
         ANSIStyle(fgcolor=Color.from_full("green"))) == "\033[38;5;2m"
     assert str(ANSIStyle(fgcolor=Color.from_simple("red"))) == "\033[31m"
Пример #5
0
 def test_ansi(self):
     self.assertEqual(str(ANSIStyle(fgcolor=Color('reset'))), '\033[39m')
     self.assertEqual(str(ANSIStyle(fgcolor=Color.from_full('green'))), '\033[38;5;2m')
     self.assertEqual(str(ANSIStyle(fgcolor=Color.from_simple('red'))), '\033[31m')
Пример #6
0
 def test_loading_methods(self):
     self.assertEqual(Color("Yellow"),
                      Color.from_full("Yellow"))
     self.assertNotEqual(Color.from_full("yellow").representation,
                         Color.from_simple("yellow").representation)