'Verify that an application with a particular restart policy in its
state and in another (or the same) policy in its configuration is
either restarted or not.
:param IRestartPolicy restart_state: The policy to put into the
application state.
:param IRestartPolicy restart_config: The policy to put into the
application configuration.
:param bool expect_restart: ``True`` if the given combination must
provoke an application restart.  ``False`` if it must not.
:raise: A test-failing exception if the restart expection is not met.'

def _app_restart_policy_test(self, restart_state, restart_config, expect_restart):

    app_state = APPLICATION_WITHOUT_VOLUME.set(restart_policy=restart_state)
    node_state = NodeState(uuid=uuid4(), hostname=u'192.0.2.10', applications={app_state})
    app_config = app_state.set(restart_policy=restart_config)
    node_config = to_node(node_state.set(applications={app_config}))
    if expect_restart:
        expected_changes = restart(app_state, app_config, node_state)
    else:
        expected_changes = no_change()
    assert_application_calculated_changes(self, node_state, node_config, set(), expected_changes)
