'If the change passed to ``run_state_change`` returns a ``Deferred``
that fails, the ``Deferred`` returned by ``run_state_change`` fails the
same way.'

@validate_logging(assertHasAction, CONTROLLABLE_ACTION_TYPE, succeeded=False)
def test_failed(self, logger):

    action = ControllableAction(result=fail(Exception('Oh    no')))
    action._logger = logger
    failure = self.failureResultOf(run_state_change(action, DEPLOYER, InMemoryStatePersister()))
    self.assertEqual(failure.getErrorMessage(), 'Oh    no')
