Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: Handle None process states in build_call_graph #6590

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/aiida/cmdline/utils/ascii_vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def calc_info(node, call_link_label: bool = False) -> str:
raise TypeError(f'Unknown type: {type(node)}')

process_label = node.process_label
process_state = node.process_state.value.capitalize()
process_state = 'None' if node.process_state is None else node.process_state.value.capitalize()
exit_status = node.exit_status

if call_link_label and (caller := node.caller):
Expand Down
20 changes: 20 additions & 0 deletions tests/cmdline/utils/test_ascii_vis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# #
# The code is hosted on GitHub at https://github.com/aiidateam/aiida-core #
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
"""Tests for the :mod:`aiida.cmdline.utils.ascii_vis` module."""

from aiida.orm.nodes.process.process import ProcessNode


def test_build_call_graph():
from aiida.cmdline.utils.ascii_vis import build_call_graph

node = ProcessNode()

call_graph = build_call_graph(node)
assert call_graph == 'None<None> None'
Loading