@@ -32,14 +32,14 @@ def test_style_none():
3232def test_style_fg ():
3333 base_str = HELLO_WORLD
3434 fg_color = 'blue'
35- ansi_str = ansi .fg . get_value ( fg_color ) + base_str + ansi .FG_RESET
35+ ansi_str = ansi .fg [ fg_color ]. value + base_str + ansi .FG_RESET
3636 assert ansi .style (base_str , fg = fg_color ) == ansi_str
3737
3838
3939def test_style_bg ():
4040 base_str = HELLO_WORLD
4141 bg_color = 'green'
42- ansi_str = ansi .bg . get_value ( bg_color ) + base_str + ansi .BG_RESET
42+ ansi_str = ansi .bg [ bg_color ]. value + base_str + ansi .BG_RESET
4343 assert ansi .style (base_str , bg = bg_color ) == ansi_str
4444
4545
@@ -65,7 +65,7 @@ def test_style_multi():
6565 base_str = HELLO_WORLD
6666 fg_color = 'blue'
6767 bg_color = 'green'
68- ansi_str = (ansi .fg . get_value ( fg_color ) + ansi .bg . get_value ( bg_color ) +
68+ ansi_str = (ansi .fg [ fg_color ]. value + ansi .bg [ bg_color ]. value +
6969 ansi .INTENSITY_BRIGHT + ansi .INTENSITY_DIM + ansi .UNDERLINE_ENABLE +
7070 base_str +
7171 ansi .FG_RESET + ansi .BG_RESET +
@@ -85,7 +85,7 @@ def test_style_color_not_exist():
8585
8686def test_fg_lookup_exist ():
8787 fg_color = 'green'
88- assert ansi .fg_lookup (fg_color ) == ansi .fg .get_value ( fg_color )
88+ assert ansi .fg_lookup (fg_color ) == ansi .fg_lookup ( ansi . fg .green )
8989
9090
9191def test_fg_lookup_nonexist ():
@@ -94,8 +94,8 @@ def test_fg_lookup_nonexist():
9494
9595
9696def test_bg_lookup_exist ():
97- bg_color = 'green '
98- assert ansi .bg_lookup (bg_color ) == ansi .bg .get_value ( bg_color )
97+ bg_color = 'red '
98+ assert ansi .bg_lookup (bg_color ) == ansi .bg_lookup ( ansi . bg .red )
9999
100100
101101def test_bg_lookup_nonexist ():
@@ -124,15 +124,9 @@ def test_async_alert_str(cols, prompt, line, cursor, msg, expected):
124124def test_fg_enum ():
125125 assert ansi .fg_lookup ('bright_red' ) == ansi .fg_lookup (ansi .fg .bright_red )
126126
127- def test_fg_enum_to_str ():
128- assert str (ansi .fg .black ) == ansi .fg_lookup ('black' )
129-
130127def test_bg_enum ():
131128 assert ansi .bg_lookup ('green' ) == ansi .bg_lookup (ansi .bg .green )
132129
133- def test_bg_enum_to_str ():
134- assert str (ansi .bg .blue ) == ansi .bg_lookup ('blue' )
135-
136130def test_fg_colors ():
137131 assert list (ansi .fg .__members__ .keys ()) == ansi .fg .colors ()
138132
0 commit comments