Skip to content

Commit d02a43f

Browse files
committed
Fixed unit test,
1 parent 0442344 commit d02a43f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_argparse_completer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from typing import cast
66

77
import pytest
8+
from rich.text import Text
89

910
import cmd2
1011
import cmd2.string_utils as su
@@ -115,7 +116,7 @@ def do_pos_and_flag(self, args: argparse.Namespace) -> None:
115116
CompletionItem('choice_1', ['Description 1']),
116117
# Make this the longest description so we can test display width.
117118
CompletionItem('choice_2', [su.stylize("String with style", style=cmd2.Color.BLUE)]),
118-
CompletionItem('choice_3', [su.stylize("Text with style", style=cmd2.Color.RED)]),
119+
CompletionItem('choice_3', [Text("Text with style", style=cmd2.Color.RED)]),
119120
)
120121

121122
# This tests that CompletionItems created with numerical values are sorted as numbers.
@@ -739,7 +740,7 @@ def test_completion_items(ac_app) -> None:
739740
assert lines[3].endswith("\x1b[34mString with style\x1b[0m ")
740741

741742
# Verify that the styled Rich Text also rendered.
742-
assert lines[4].endswith("\x1b[31mText with style\x1b[0m ")
743+
assert lines[4].endswith("\x1b[31mText with style \x1b[0m ")
743744

744745
# Now test CompletionItems created from numbers
745746
text = ''

0 commit comments

Comments
 (0)