예제 #1
0
async def test_app_record_transaction_invalid_data(app):
    bus = bus_service.BusService(messagebus_uri=app.config['messagebus_uri'])
    await bus.connect()
    #
    request = {}
    response = await bus.rpc_call(method=MethodName.RECORD_TRANSACTION.value,
                                  kwargs={'request': dict(request)})
    assert response is not None
    assert response.get('errors') is not None
    #
    await bus.close()
예제 #2
0
async def test_app_begin_transaction(app):
    bus = bus_service.BusService(messagebus_uri=app.config['messagebus_uri'])
    await bus.connect()
    #
    request = schema.BeginTransactionRequest(transaction_tag="100")
    response = await bus.rpc_call(
        method=MethodName.BEGIN_TRANSACTION.value,
        kwargs={'request': dict(request)},
    )
    assert response is not None
    assert response['ok'] is False
    #
    await bus.close()
예제 #3
0
async def test_app_authorization_invalid_data(app):
    bus = bus_service.BusService(messagebus_uri=app.config['messagebus_uri'])
    await bus.connect()
    #
    request = {}
    response = await bus.rpc_call(
        method=MethodName.AUTHORIZATION.value,
        kwargs={'request': dict(request)},
    )
    assert response is not None
    assert response.get('errors') is not None
    #
    await bus.close()
예제 #4
0
async def test_app_authorization(app):
    bus = bus_service.BusService(messagebus_uri=app.config['messagebus_uri'])
    await bus.connect()
    #
    request = schema.AuthorizationRequest(transaction_tag="100")
    response = await bus.rpc_call(
        method=MethodName.AUTHORIZATION.value,
        kwargs={'request': dict(request)},
    )
    assert response is not None
    assert response['authorized'] is False
    #
    await bus.close()
예제 #5
0
async def test_app_authorization_transaction_async(app):
    bus = bus_service.BusService(messagebus_uri=app.config['messagebus_uri'])
    await bus.connect()
    #
    request = schema.AuthorizationTransactionRequest(
        transaction_tag="100", timestamp_auth=datetime.utcnow())
    response = await bus.rpc_call_async(
        method=MethodName.AUTHORIZATION_TRANSACTION.value,
        kwargs={'request': dict(request)},
        expiration=60,
    )
    assert response is True
    #
    await bus.close()