diff --git a/src/aiida/cmdline/utils/ascii_vis.py b/src/aiida/cmdline/utils/ascii_vis.py index f42317e7a8..502abf3bcf 100644 --- a/src/aiida/cmdline/utils/ascii_vis.py +++ b/src/aiida/cmdline/utils/ascii_vis.py @@ -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): diff --git a/tests/cmdline/utils/test_ascii_vis.py b/tests/cmdline/utils/test_ascii_vis.py new file mode 100644 index 0000000000..9fb6d26423 --- /dev/null +++ b/tests/cmdline/utils/test_ascii_vis.py @@ -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'