Coverage for pytestzoo/main.py: 100.00%

21 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-08-12 01:37 +0000

1import typer 

2 

3from . import strings 

4 

5app = typer.Typer() 

6 

7@app.command() 

8def reverse_string(string: str = typer.Argument("", help="A string to reverse")): 

9 """Reverse a string.""" 

10 if not string: 

11 string = typer.prompt("Please enter a string to reverse") 

12 result = strings.reverse_string(string) 

13 print(result) 

14 

15 

16@app.command() 

17def is_palindrome(string: str = typer.Argument("", help="A string to check for palindrome")): 

18 """Check if a string is a palindrome.""" 

19 if not string: 

20 string = typer.prompt("Please enter a string to check for palindrome") 

21 result = strings.is_palindrome(string) 

22 print("Yes" if result else "No") 

23 

24 

25@app.command() 

26def count_vowels(string: str = typer.Argument("", help="A string to count vowels")): 

27 """Count the number of vowels in a string.""" 

28 if not string: 

29 string = typer.prompt("Please enter a string to count vowels") 

30 result = strings.count_vowels(string) 

31 print(result)