def test_present_set_target_failed(self):
        name = 'saltdude'
        target = 'dude@saltstack.com'
        ret = {'comment': 'Failed to set alias {0} -> {1}'.format(name, target),
               'changes': {},
               'name': name,
               'result': False}

        has_target = MagicMock(return_value=False)
        set_target = MagicMock(return_value=False)
        with patch.dict(alias.__salt__, {'aliases.has_target': has_target}):
            with patch.dict(alias.__opts__, {'test': False}):
                with patch.dict(alias.__salt__, {'aliases.set_target': set_target}):
                    self.assertEqual(alias.present(name, target), ret)
Raise application error helper method.
dataset/ETHPy150Open saltstack/salt/tests/unit/states/alias_test.py/AliasTest.test_present_set_target_failed--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/files/file_service_stub.py/raise_error