async def test_create_pres_bad_revoc_state(self):
    pres_request = V20PresRequest(formats=[V20PresFormat(attach_id='indy', format_=ATTACHMENT_FORMAT[PRES_20_REQUEST][V20PresFormat.Format.INDY.api])], request_presentations_attach=[AttachDecorator.data_base64(INDY_PROOF_REQ_NAME, ident='indy')])
    px_rec_in = V20PresExRecord(pres_request=pres_request.serialize())
    Holder = async_mock.MagicMock(IndyHolder, autospec=True)
    self.holder = Holder()
    get_creds = async_mock.CoroutineMock(return_value=({'cred_info': {'referent': 'dummy_reft'}, 'attrs': {'player': 'Richie Knucklez', 'screenCapture': 'aW1hZ2luZSBhIHNjcmVlbiBjYXB0dXJl', 'highScore': '1234560'}},))
    self.holder.get_credentials_for_presentation_request_by_referent = get_creds
    self.holder.get_credential = async_mock.CoroutineMock(return_value=json.dumps({'schema_id': S_ID, 'cred_def_id': CD_ID, 'rev_reg_id': RR_ID, 'cred_rev_id': 1}))
    self.holder.create_presentation = async_mock.CoroutineMock(return_value='{}')
    self.holder.create_revocation_state = async_mock.CoroutineMock(side_effect=test_module.IndyHolderError('Problem', {'message': 'Nope'}))
    self.profile.context.injector.bind_instance(IndyHolder, self.holder)
    more_magic_rr = async_mock.MagicMock(get_or_fetch_local_tails_path=async_mock.CoroutineMock(return_value='/tmp/sample/tails/path'))
    with async_mock.patch.object(V20PresExRecord, 'save', autospec=True) as save_ex, async_mock.patch.object(test_module, 'AttachDecorator', autospec=True) as mock_attach_decorator, async_mock.patch.object(test_module, 'RevocationRegistry', autospec=True) as mock_rr:
        mock_rr.from_definition = async_mock.MagicMock(return_value=more_magic_rr)
        mock_attach_decorator.data_base64 = async_mock.MagicMock(return_value=mock_attach_decorator)
        req_creds = (await indy_proof_req_preview2indy_requested_creds(INDY_PROOF_REQ_NAME, preview=None, holder=self.holder))
        with self.assertRaises(test_module.IndyHolderError):
            (await self.manager.create_pres(px_rec_in, req_creds))
async def test_create_pres_bad_revoc_state(self):
    pres_request = V20PresRequest(formats=[V20PresFormat(attach_id='indy', format_=ATTACHMENT_FORMAT[PRES_20_REQUEST][V20PresFormat.Format.INDY.api])], request_presentations_attach=[AttachDecorator.data_base64(INDY_PROOF_REQ_NAME, ident='indy')])
    px_rec_in = V20PresExRecord(pres_request=pres_request.serialize())
    Holder = async_mock.MagicMock(IndyHolder, autospec=True)
    self.holder = Holder()
    get_creds = async_mock.CoroutineMock(return_value=({'cred_info': {'referent': 'dummy_reft'}, 'attrs': {'player': 'Richie Knucklez', 'screenCapture': 'aW1hZ2luZSBhIHNjcmVlbiBjYXB0dXJl', 'highScore': '1234560'}},))
    self.holder.get_credentials_for_presentation_request_by_referent = get_creds
    self.holder.get_credential = async_mock.CoroutineMock(return_value=json.dumps({'schema_id': S_ID, 'cred_def_id': CD_ID, 'rev_reg_id': RR_ID, 'cred_rev_id': 1}))
    self.holder.create_presentation = async_mock.CoroutineMock(return_value='{}')
    self.holder.create_revocation_state = async_mock.CoroutineMock(side_effect=test_module.IndyHolderError('Problem', {'message': 'Nope'}))
    self.profile.context.injector.bind_instance(IndyHolder, self.holder)
    more_magic_rr = async_mock.MagicMock(get_or_fetch_local_tails_path=async_mock.CoroutineMock(return_value='/tmp/sample/tails/path'))
    with async_mock.patch.object(V20PresExRecord, 'save', autospec=True) as save_ex, async_mock.patch.object(test_module, 'AttachDecorator', autospec=True) as mock_attach_decorator, async_mock.patch.object(test_module, 'RevocationRegistry', autospec=True) as mock_rr:
        mock_rr.from_definition = async_mock.MagicMock(return_value=more_magic_rr)
        mock_attach_decorator.data_base64 = async_mock.MagicMock(return_value=mock_attach_decorator)
        req_creds = (await indy_proof_req_preview2indy_requested_creds(INDY_PROOF_REQ_NAME, preview=None, holder=self.holder))
        with self.assertRaises(test_module.IndyHolderError):
            (await self.manager.create_pres(px_rec_in, req_creds))