Skip to content

Commit

Permalink
Improve cleo._utils coverage (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
Secrus authored Feb 25, 2024
1 parent 730aea8 commit c9959d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/408.feat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved coverage for `cleo._utils` module
8 changes: 8 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from cleo._utils import find_similar_names
from cleo._utils import format_time
from cleo._utils import strip_tags


@pytest.mark.parametrize(
Expand Down Expand Up @@ -39,3 +40,10 @@ def test_format_time(input_secs: float, expected: str) -> None:
def test_find_similar_names(name: str, expected: list[str]) -> None:
names = ["help", "foo1", "foo2", "bar1", "bar2", "foo bar1", "foo bar2"]
assert find_similar_names(name, names) == expected


@pytest.mark.parametrize(
"value, expected", (("<ab> cde</>", " cde"), ("<ab", "<ab"), ("cd>", "cd>"))
)
def test_strip_tags(value: str, expected: str) -> None:
assert strip_tags(value) == expected

0 comments on commit c9959d9

Please sign in to comment.