#NEWLINE# def _app_restart_policy_test( self , restart_state , restart_config , expect_restart ) : #NEWLINE# #INDENT# '\n        Verify that an application with a particular restart policy in its\n        state and in another (or the same) policy in its configuration is\n        either restarted or not.\n\n        :param IRestartPolicy restart_state: The policy to put into the\n            application state.\n        :param IRestartPolicy restart_config: The policy to put into the\n            application configuration.\n        :param bool expect_restart: ``True`` if the given combination must\n            provoke an application restart.  ``False`` if it must not.\n\n        :raise: A test-failing exception if the restart expection is not met.\n        ' #NEWLINE# app_state = APPLICATION_WITHOUT_VOLUME . set ( restart_policy = restart_state ) #NEWLINE# node_state = NodeState ( uuid = uuid4 ( ) , hostname = '192.0.2.10' , applications = { app_state } ) #NEWLINE# app_config = app_state . set ( restart_policy = app_config ) #NEWLINE# node_config = to_node ( node_state . set ( applications = { app_config } ) ) #NEWLINE# if expect_restart : #NEWLINE# #INDENT# expected_changes = restart ( app_state , app_config , node_state ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# expected_changes = no_change ( ) #NEWLINE# #UNINDENT# assert_application_calculated_changes ( self , node_state , node_config , set ( ) , expected_changes )