Coverage for frappe_manager / commands / list.py: 100%

14 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-07-02 18:13 +0530

1import typer 

2from typer_examples import example 

3 

4from frappe_manager import ( 

5 CLI_BENCHES_DIRECTORY, 

6) 

7from frappe_manager.output_manager import get_global_output_handler 

8from frappe_manager.site_manager.bench_service import BenchService 

9 

10 

11@example( 

12 "List all available benches", 

13 "", 

14 detail="Shows a table of all benches managed by FM with status and environment information.", 

15) 

16def list(ctx: typer.Context): 

17 """ 

18 List all benches. 

19 

20 Displays a table showing all available benches with their status, environment type, 

21 and other relevant information. Use this to see what benches exist on your system. 

22 """ 

23 

24 services_manager = ctx.obj["services"] 

25 verbose = ctx.obj["verbose"] 

26 

27 output = get_global_output_handler() 

28 bench_service = BenchService(CLI_BENCHES_DIRECTORY, services_manager, verbose=verbose, output_handler=output) 

29 table = bench_service.list_benches_table() 

30 if table.row_count: 

31 output.print_data(table)