Coverage for compiler_admin / commands / user / backupcodes.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-28 05:48 +0000

1import click 

2 

3from compiler_admin import Result 

4from compiler_admin.services.google import GoogleAccount 

5 

6 

7@click.command() 

8@click.argument("username") 

9def backupcodes(username: str, **kwargs): 

10 """Get backup codes for the user, creating a new set if needed.""" 

11 account = GoogleAccount(username) 

12 

13 if not account.exists(): 

14 click.echo(f"User does not exist: {account}") 

15 raise SystemExit(Result.FAILURE) 

16 

17 backup_codes = account.get_backup_codes() 

18 click.echo(backup_codes)