Skip to content

Commit

Permalink
rough implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
benclifford committed Oct 9, 2023
1 parent 3badf9d commit dfd4d85
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions parsl/tests/test_python_apps/test_lifted_dict.py
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

0 comments on commit dfd4d85

Please sign in to comment.