-
Notifications
You must be signed in to change notification settings - Fork 199
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
1 parent
3badf9d
commit dfd4d85
Showing
1 changed file
with
23 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from parsl import python_app | ||
|
||
|
||
@python_app | ||
def returns_a_dict(): | ||
return {"a": "X", "b": "Y"} | ||
|
||
|
||
def test_returns_a_dict(): | ||
|
||
# precondition that returns_a_dict behaves | ||
# correctly | ||
assert returns_a_dict().result()["a"] == "X" | ||
|
||
# check that the deferred __getitem__ functionality works, | ||
# allowing [] to be used on an AppFuture | ||
assert returns_a_dict()["a"].result() == "X" | ||
|
||
# other things to test: when the result is a sequence, so that | ||
# [] is a position | ||
|
||
# when the result is not indexable, a sensible error should | ||
# appear in the appropriate future |