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

12 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-09 18:26 +0000

1import typer 1abcdefgh

2 

3app = typer.Typer() 1abcdefgh

4 

5 

6@app.command() 1abcdefgh

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

8 """ 

9 Say hi 

10 """ 

11 if formal: 1abcdefgh

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

13 else: 

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

15 

16 

17@app.command() 1abcdefgh

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

19 """ 

20 Say bye 

21 """ 

22 if friend: 1abcdefgh

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

24 else: 

25 typer.echo("Goodbye") 1abcdefgh