def _test_nested_change(case, outer_factory, inner_factory):
 inner_action = ControllableAction(result=succeed(None))
 subchanges = [ControllableAction(result=succeed(None)), inner_factory(changes=[inner_action]), ControllableAction(result=succeed(None))]
 change = outer_factory(changes=subchanges)
 run_state_change(change, DEPLOYER, InMemoryStatePersister())
 case.assertEqual((True, DEPLOYER), (inner_action.called, inner_action.deployer))

def _test_nested_change ( case , outer_factory , inner_factory ) : inner_action = ControllableAction ( result = succeed ( None ) ) subchanges = [ ControllableAction ( result = succeed ( None ) ) , inner_factory ( changes = [ inner_action ] ) , ControllableAction ( result = succeed ( None ) ) ] change = outer_factory ( changes = subchanges ) run_state_change ( change , DEPLOYER , InMemoryStatePersister ( ) ) case . assertEqual ( ( True , DEPLOYER ) , ( inner_action . called , inner_action . deployer ) )
assert that ichangestate providers wrapped inside inner_factory wrapped inside outer_factory are run with the same deployer argument as is passed to run_state_change .