()
| 6 | |
| 7 | |
| 8 | def test_str(): |
| 9 | assert str(Style(bold=False)) == "not bold" |
| 10 | assert str(Style(color="red", bold=False)) == "not bold red" |
| 11 | assert str(Style(color="red", bold=False, italic=True)) == "not bold italic red" |
| 12 | assert str(Style()) == "none" |
| 13 | assert str(Style(bold=True)) == "bold" |
| 14 | assert str(Style(color="red", bold=True)) == "bold red" |
| 15 | assert str(Style(color="red", bgcolor="black", bold=True)) == "bold red on black" |
| 16 | all_styles = Style( |
| 17 | color="red", |
| 18 | bgcolor="black", |
| 19 | bold=True, |
| 20 | dim=True, |
| 21 | italic=True, |
| 22 | underline=True, |
| 23 | blink=True, |
| 24 | blink2=True, |
| 25 | reverse=True, |
| 26 | conceal=True, |
| 27 | strike=True, |
| 28 | underline2=True, |
| 29 | frame=True, |
| 30 | encircle=True, |
| 31 | overline=True, |
| 32 | ) |
| 33 | expected = "bold dim italic underline blink blink2 reverse conceal strike underline2 frame encircle overline red on black" |
| 34 | assert str(all_styles) == expected |
| 35 | assert str(Style(link="foo")) == "link foo" |
| 36 | |
| 37 | |
| 38 | def test_ansi_codes(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…