Skip to content

Commit e02c2bb

Browse files
committed
Handle non-string sensitive configs
1 parent 8c95e60 commit e02c2bb

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lean/commands/config/list.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def list() -> None:
2929
table.add_column("Description", overflow="fold")
3030

3131
for option in container.cli_config_manager.all_options:
32-
value = option.get_value(default="<not set>")
32+
value = str(option.get_value(default="<not set>"))
3333

3434
# Mask values of sensitive options
3535
if value != "<not set>" and option.is_sensitive:

tests/commands/config/test_list.py

+8
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,11 @@ def test_config_list_does_not_show_complete_values_of_sensitive_options(size) ->
4646

4747
assert "123" not in result.output
4848
assert "abcdefghijklmnopqrstuvwxyz" not in result.output
49+
50+
51+
def test_handles_non_string_sensitive_configs() -> None:
52+
container.cli_config_manager.user_id.set_value(123)
53+
54+
result = CliRunner().invoke(lean, ["config", "list"])
55+
56+
assert result.exit_code == 0

0 commit comments

Comments
 (0)