From de0288524014c21a241d207a558e7da695265f5f Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Wed, 2 Oct 2019 04:09:21 +0300 Subject: [PATCH] test(dag,#25): FAILing TC for overriding intermediate data --- test/test_graphkit.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test_graphkit.py b/test/test_graphkit.py index bd97b317..9a6473cf 100644 --- a/test/test_graphkit.py +++ b/test/test_graphkit.py @@ -184,6 +184,17 @@ def test_pruning_raises_for_bad_output(): outputs=['sum1', 'sum3', 'sum4']) +def test_pruning_not_overrides_given_intermediate(): + # Test #25: not overriding intermediate data when an output is not asked + graph = compose(name="graph")( + operation(name="unjustly run", needs=["a"], provides=["overriden"])(lambda a: a), + operation(name="op", needs=["overriden", "c"], provides=["asked"])(add), + ) + + assert graph({"a": 5, "overriden": 1, "c": 2}, ["asked"]) == {"asked": 3} # that"s ok + assert graph({"a": 5, "overriden": 1, "c": 2}) == {"a": 5, "overriden": 1, "c": 2, "asked": 3} # FAILs + + def test_optional(): # Test that optional() needs work as expected.