33from rich .style import Style
44
55from cmd2 import (
6- ColorName ,
6+ Color ,
77 rich_utils ,
88)
99from cmd2 import (
@@ -59,7 +59,7 @@ def test_align_left_wide_text() -> None:
5959def test_align_left_with_style () -> None :
6060 character = '-'
6161
62- styled_text = su .stylize ('table' , style = ColorName .BRIGHT_BLUE )
62+ styled_text = su .stylize ('table' , style = Color .BRIGHT_BLUE )
6363 width = 8
6464
6565 aligned = su .align_left (styled_text , width = width , character = character )
@@ -85,7 +85,7 @@ def test_align_center_wide_text() -> None:
8585def test_align_center_with_style () -> None :
8686 character = '-'
8787
88- styled_text = su .stylize ('table' , style = ColorName .BRIGHT_BLUE )
88+ styled_text = su .stylize ('table' , style = Color .BRIGHT_BLUE )
8989 width = 8
9090
9191 aligned = su .align_center (styled_text , width = width , character = character )
@@ -111,7 +111,7 @@ def test_align_right_wide_text() -> None:
111111def test_align_right_with_style () -> None :
112112 character = '-'
113113
114- styled_text = su .stylize ('table' , style = ColorName .BRIGHT_BLUE )
114+ styled_text = su .stylize ('table' , style = Color .BRIGHT_BLUE )
115115 width = 8
116116
117117 aligned = su .align_right (styled_text , width = width , character = character )
@@ -122,8 +122,8 @@ def test_stylize() -> None:
122122 styled_str = su .stylize (
123123 HELLO_WORLD ,
124124 style = Style (
125- color = ColorName .GREEN ,
126- bgcolor = ColorName .BLUE ,
125+ color = Color .GREEN ,
126+ bgcolor = Color .BLUE ,
127127 bold = True ,
128128 underline = True ,
129129 ),
@@ -134,15 +134,15 @@ def test_stylize() -> None:
134134
135135def test_strip_style () -> None :
136136 base_str = HELLO_WORLD
137- styled_str = su .stylize (base_str , style = ColorName .GREEN )
137+ styled_str = su .stylize (base_str , style = Color .GREEN )
138138 assert base_str != styled_str
139139 assert base_str == su .strip_style (styled_str )
140140
141141
142142def test_str_width () -> None :
143143 # Include a full-width character
144144 base_str = HELLO_WORLD + "深"
145- styled_str = su .stylize (base_str , style = ColorName .GREEN )
145+ styled_str = su .stylize (base_str , style = Color .GREEN )
146146 expected_width = len (HELLO_WORLD ) + 2
147147 assert su .str_width (base_str ) == su .str_width (styled_str ) == expected_width
148148
0 commit comments