-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a convenience property that returns an `ExitCode` from a process node as long as both the `exit_status` and `exit_message` attributes have been defined.
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Tests for :mod:`aiida.orm.nodes.process.process`.""" | ||
from aiida.engine import ExitCode | ||
from aiida.orm.nodes.process.process import ProcessNode | ||
|
||
|
||
def test_exit_code(): | ||
"""Test the :meth:`aiida.orm.nodes.process.process.ProcessNode.exit_code` property.""" | ||
node = ProcessNode() | ||
assert node.exit_code is None | ||
|
||
node.set_exit_status(418) | ||
assert node.exit_code is None | ||
|
||
node.set_exit_message('I am a teapot') | ||
assert node.exit_code == ExitCode(418, 'I am a teapot') |