#NEWLINE# def test_expected_optional_multiplers( self ) : #NEWLINE# #INDENT# flow_no_inject = lf . Flow ( 'flow' ) #NEWLINE# flow_no_inject . add ( utils . OptionalTask ( provides = 'result' ) ) #NEWLINE# flow_inject_a = lf . Flow ( 'flow' ) #NEWLINE# flow_inject_a . add ( utils . OptionalTask ( provides = 'result' , inject = { #NEWLINE# #INDENT# 'a' : 10 , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# flow_inject_b = lf . Flow ( 'flow' ) #NEWLINE# flow_inject_b . add ( utils . OptionalTask ( provides = 'result' , inject = { #NEWLINE# #INDENT# 'b' : 1000 , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# engine = self . _make_engine ( flow_no_inject , store = { #NEWLINE# #INDENT# 'a' : 3 , #NEWLINE# #UNINDENT# } ) #NEWLINE# engine . run ( ) #NEWLINE# result = engine . storage . fetch_all ( ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# 'a' : 3 , #NEWLINE# 'result' : 15 , #NEWLINE# #UNINDENT# } , result ) #NEWLINE# engine = self . _make_engine ( flow_no_inject , store = { #NEWLINE# #INDENT# 'a' : 3 , #NEWLINE# 'b' : 7 , #NEWLINE# #UNINDENT# } ) #NEWLINE# engine . run ( ) #NEWLINE# result = engine . storage . fetch_all ( ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# 'a' : 3 , #NEWLINE# 'b' : 7 , #NEWLINE# 'result' : 21 , #NEWLINE# #UNINDENT# } , result ) #NEWLINE# engine = self . _make_engine ( flow_inject_a , store = { #NEWLINE# #INDENT# 'a' : 3 , #NEWLINE# #UNINDENT# } ) #NEWLINE# engine . run ( ) #NEWLINE# result = engine . storage . fetch_all ( ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# 'a' : 3 , #NEWLINE# 'result' : 50 , #NEWLINE# #UNINDENT# } , result ) #NEWLINE# engine = self . _make_engine ( flow_inject_a , store = { #NEWLINE# #INDENT# 'a' : 3 , #NEWLINE# 'b' : 7 , #NEWLINE# #UNINDENT# } ) #NEWLINE# engine . run ( ) #NEWLINE# result = engine . storage . fetch_all ( ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# 'a' : 3 , #NEWLINE# 'b' : 7 , #NEWLINE# 'result' : 70 , #NEWLINE# #UNINDENT# } , result ) #NEWLINE# engine = self . _make_engine ( flow_inject_b , store = { #NEWLINE# #INDENT# 'a' : 3 , #NEWLINE# #UNINDENT# } ) #NEWLINE# engine . run ( ) #NEWLINE# result = engine . storage . fetch_all ( ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# 'a' : 3 , #NEWLINE# 'result' : 3000 , #NEWLINE# #UNINDENT# } , result ) #NEWLINE# engine = self . _make_engine ( flow_inject_b , store = { #NEWLINE# #INDENT# 'a' : 3 , #NEWLINE# 'b' : 7 , #NEWLINE# #UNINDENT# } ) #NEWLINE# engine . run ( ) #NEWLINE# result = engine . storage . fetch_all ( ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# 'a' : 3 , #NEWLINE# 'b' : 7 , #NEWLINE# 'result' : 3000 , #NEWLINE# #UNINDENT# } , result )