'If the supplied application configuration has a ``restart_policy`` key,
``_parse_restart_policy`` is called with the value of that key.'

def test_parse_restart_policy_is_called(self):

    expected_application_name = u'red-fish'
    expected_restart_policy_configuration = object()
    expected_restart_policy = object()
    config = {u'applications': {expected_application_name: {u'image': u'seuss/one-fish-two-fish', u'restart_policy': expected_restart_policy_configuration}}, u'version': 1}
    parser = FlockerConfiguration(config)
    recorded_arguments = []
    def spy_parse_restart_policy(*args, **kwargs):
        recorded_arguments.append((args, kwargs))
        return expected_restart_policy
    self.patch(parser, u'_parse_restart_policy', spy_parse_restart_policy)
    applications = parser.applications()
    self.assertEqual([(tuple(), dict(application_name=expected_application_name, config=expected_restart_policy_configuration))], recorded_arguments)
    self.assertEqual(expected_restart_policy, applications[expected_application_name].restart_policy)
