Skip to content

Commit 3bc0070

Browse files
committed
Add unit test for case when a str is passed to rich-to_pt_style
1 parent f10f42b commit 3bc0070

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/test_pt_utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,13 @@ class TestRichToPtStyle:
642642
def test_rich_to_pt_style_none(self):
643643
assert pt_utils.rich_to_pt_style(None) == ""
644644

645+
def test_rich_to_pt_style_string(self):
646+
pt_style = pt_utils.rich_to_pt_style("bold red on blue")
647+
assert "fg:ansired" in pt_style
648+
assert "bg:ansiblue" in pt_style
649+
assert "bold" in pt_style
650+
assert "nobold" not in pt_style
651+
645652
def test_rich_to_pt_style_color(self):
646653
from rich.style import Style
647654

0 commit comments

Comments
 (0)