forked from aiidateam/plumpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
30 additions
and
8 deletions.
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
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,21 @@ | ||
from plumpy.event_helper import EventHelper | ||
from plumpy.persistence import Savable, load | ||
from tests.utils import DummyProcess, ProcessListenerTester | ||
|
||
|
||
def test_event_helper_savable(): | ||
eh = EventHelper(ProcessListenerTester) | ||
|
||
proc = DummyProcess() | ||
pl1 = ProcessListenerTester(proc, ('killed')) | ||
pl2 = ProcessListenerTester(proc, ('paused')) | ||
eh.add_listener(pl1) | ||
eh.add_listener(pl2) | ||
|
||
assert isinstance(eh, Savable) | ||
|
||
saved = eh.save() | ||
loaded = load(saved_state=saved) | ||
saved2 = loaded.save() | ||
|
||
assert saved == saved2 |
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