Coverage for tests/assets/cli/sample.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-03-10 00:15 +0000

1import typer 1abcdefghi

2 

3app = typer.Typer() 1abcdefghi

4 

5 

6@app.command() 1abcdefghi

7def hello(name: str = "World", formal: bool = False): 1abcdefghi

8 """ 

9 Say hi 

10 """ 

11 if formal: 1abcdefghi

12 typer.echo(f"Good morning Ms. {name}") 1abcdefghi

13 else: 

14 typer.echo(f"Hello {name}!") 1abcdefghi

15 

16 

17@app.command() 1abcdefghi

18def bye(friend: bool = False): 1abcdefghi

19 """ 

20 Say bye 

21 """ 

22 if friend: 1abcdefghi

23 typer.echo("Goodbye my friend") 1abcdefghi

24 else: 

25 typer.echo("Goodbye") 1abcdefghi