Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Apr 27, 2024
1 parent 572b007 commit 1b3c45c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion logfire/_internal/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def parse_clean(args: argparse.Namespace) -> None:
sys.stderr.write(f'No Logfire data found in {data_dir.resolve()}\n')
sys.exit(1)

confirm = input(f'The folder {data_dir.resolve()} will be deleted. Are you sure? [N/y]')
confirm = input(f'The folder {data_dir.resolve()} will be deleted. Are you sure? [N/y] ')
if confirm.lower() in ('yes', 'y'):
shutil.rmtree(data_dir)
sys.stderr.write('Cleaned Logfire data.\n')
Expand Down
7 changes: 7 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,3 +1068,10 @@ def test_projects_use_write_token_error(tmp_dir_cwd: Path, default_credentials:

with pytest.raises(LogfireConfigError, match='Error creating project write token.'):
main(['projects', 'use', 'myproject', '--org', 'fake_org'])


def test_info(capsys: pytest.CaptureFixture[str]) -> None:
main(['info'])
output = capsys.readouterr().err.strip()
assert output.startswith('logfire="')
assert '[related_packages]' in output

0 comments on commit 1b3c45c

Please sign in to comment.