Skip to content

Commit

Permalink
Apply review
Browse files Browse the repository at this point in the history
  • Loading branch information
khsrali committed May 23, 2024
1 parent 7a8a06b commit 5cf9027
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/aiida/cmdline/commands/cmd_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def plugin_list(entry_point_group, entry_point):
else:
try:
if (inspect.isclass(plugin) and issubclass(plugin, Process)) or (
False if not hasattr(plugin, 'is_process_function') else plugin.is_process_function
hasattr(plugin, 'is_process_function') and plugin.is_process_function
):
print_process_info(plugin)
else:
Expand Down
7 changes: 3 additions & 4 deletions tests/cmdline/commands/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pytest
from aiida.cmdline.commands import cmd_plugin
from aiida.parsers import Parser
from aiida.plugins import CalculationFactory, WorkflowFactory
from aiida.plugins import CalculationFactory, ParserFactory, WorkflowFactory
from aiida.plugins.entry_point import ENTRY_POINT_GROUP_TO_MODULE_PATH_MAP


Expand Down Expand Up @@ -66,11 +66,10 @@ def get_description(cls) -> str:


def test_plugin_description(run_cli_command, entry_points):
"""Test if `verdi plugin list` would show description of an external plugin."""
from aiida.plugins import ParserFactory
"""Test that ``verdi plugin list`` uses ``get_description`` if defined."""

entry_points.add(CustomParser, 'aiida.parsers:custom.parser')
assert ParserFactory('custom.parser') is CustomParser

result = run_cli_command(cmd_plugin.plugin_list, ['aiida.parsers', 'custom.parser'])
assert result.stdout_bytes.decode('utf-8').strip() == 'str69'
assert result.output.strip() == 'str69'

0 comments on commit 5cf9027

Please sign in to comment.