From dfd4d8592033a307bad1259bc07d69dd9a46568c Mon Sep 17 00:00:00 2001 From: Ben Clifford Date: Mon, 9 Oct 2023 11:32:14 +0000 Subject: [PATCH] rough implementation --- .../test_python_apps/test_lifted_dict.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 parsl/tests/test_python_apps/test_lifted_dict.py diff --git a/parsl/tests/test_python_apps/test_lifted_dict.py b/parsl/tests/test_python_apps/test_lifted_dict.py new file mode 100644 index 0000000000..acf3d6389f --- /dev/null +++ b/parsl/tests/test_python_apps/test_lifted_dict.py @@ -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