File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
import re
2
+ from collections .abc import Sequence
2
3
3
4
from typer import Typer
4
5
from typer .testing import CliRunner
@@ -13,7 +14,7 @@ def __init__(self, app: Typer) -> None:
13
14
self .app = app
14
15
self .colorstrip = re .compile (r"\x1b\[[0-9;]*m" )
15
16
16
- def output (self , commands : list [str ]) -> list [str ]:
17
+ def output (self , commands : Sequence [str ]) -> list [str ]:
17
18
"""Invoke the CLI commands and return the output as a list of strings."""
18
19
result = super ().invoke (self .app , commands , prog_name = "zebra" )
19
20
assert result .exit_code == 0 , (
@@ -23,7 +24,9 @@ def output(self, commands: list[str]) -> list[str]:
23
24
raise result .exception
24
25
return [self .colorstrip .sub ("" , line ) for line in result .output .split ("\n " )]
25
26
26
- def check_output (self , commands : list [str ], expected_patterns : list [str ]) -> None :
27
+ def check_output (
28
+ self , commands : Sequence [str ], expected_patterns : Sequence [str ]
29
+ ) -> None :
27
30
"""Check if the output contains all expected patterns."""
28
31
output = self .output (commands )
29
32
for pattern in expected_patterns :
You can’t perform that action at this time.
0 commit comments