def test_loading_methods(self):
     assert Color("Yellow") == Color.from_full("Yellow")
     assert (Color.from_full("yellow").representation !=
                         Color.from_simple("yellow").representation)
Exemplo n.º 2
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'
 def test_simple_name(self):
     green = Color.from_simple('green')
     assert green.number == 2
 def test_different_names(self):
     assert Color('Dark Blue') == Color('Dark_Blue')
     assert Color('Dark_blue') == Color('Dark_Blue')
     assert Color('DARKBLUE') == Color('Dark_Blue')
     assert Color('DarkBlue') == Color('Dark_Blue')
     assert Color('Dark Green') == Color('Dark_Green')
Exemplo n.º 5
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"
 def test_rgb(self):
     blue = Color(0,0,255) # Red, Green, Blue
     assert blue.rgb == (0,0,255)
Exemplo n.º 7
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"
Exemplo n.º 8
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'
Exemplo n.º 9
0
 def test_different_names(self):
     assert Color("Dark Blue") == Color("Dark_Blue")
     assert Color("Dark_blue") == Color("Dark_Blue")
     assert Color("DARKBLUE") == Color("Dark_Blue")
     assert Color("DarkBlue") == Color("Dark_Blue")
     assert Color("Dark Green") == Color("Dark_Green")
Exemplo n.º 10
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')
Exemplo n.º 11
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)
Exemplo n.º 12
0
 def test_simple_name(self):
     green = Color.from_simple('green')
     self.assertEqual(green.number, 2)
Exemplo n.º 13
0
 def test_rgb(self):
     blue = Color(0,0,255) # Red, Green, Blue
     self.assertEqual(blue.rgb, (0,0,255))