Skip to content

Commit 34835ae

Browse files
committed
fix: list function shadows built-in
Signed-off-by: habeck <habeck@us.ibm.com>
1 parent cf298a0 commit 34835ae

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

cpex/tools/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def bootstrap(
252252
raise typer.Exit(EXIT_OPERATION_FAILED)
253253

254254

255-
def list(type: str, fmt: str = "text") -> None:
255+
def list_registered_plugins(type: str, fmt: str = "text") -> None:
256256
"""List the installed plugins
257257
Args:
258258
type (str): The type of plugins to list. Can be "native" or "external".
@@ -865,7 +865,7 @@ def plugin(
865865
return versions(source, catalog=pc, fmt=fmt)
866866

867867
if cmd_action == "list":
868-
return list(install_type, fmt=fmt)
868+
return list_registered_plugins(install_type, fmt=fmt)
869869
if cmd_action == "install" and source is not None:
870870
return install(source, install_type, catalog=pc, assume_yes=assume_yes)
871871
if cmd_action == "search":

tests/unit/cpex/tools/test_cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
command_exists,
3030
git_user_email,
3131
git_user_name,
32-
list,
32+
list_registered_plugins,
3333
install_from_manifest,
3434
install,
3535
search,
@@ -474,7 +474,7 @@ class TestListFunction:
474474
def test_list_with_no_registry_file(self, temp_registry_dir):
475475
"""Test list when registry file doesn't exist."""
476476
with patch("cpex.tools.cli.logger") as mock_logger:
477-
list("all")
477+
list_registered_plugins("all")
478478
mock_logger.info.assert_called_with("No plugins registered.")
479479

480480
def test_list_with_existing_plugins(self, temp_registry_dir):
@@ -505,7 +505,7 @@ def test_list_with_existing_plugins(self, temp_registry_dir):
505505
registry_file.write_text(json.dumps(registry_data))
506506

507507
with patch("cpex.tools.cli.console") as mock_console:
508-
list("all")
508+
list_registered_plugins("all")
509509
assert mock_console.print.call_count == 2
510510

511511

0 commit comments

Comments
 (0)