Ejemplo n.º 1
0
def stored_request_real(redis_client):
    new_req = AcquisitionRequest(**TEST_ACQUISITION_REQ_JSON)
    new_req.timestamps['VALIDATED'] = 1449523225
    redis_client.hset(
        AcquisitionRequestStore.REDIS_HASH_NAME,
        AcquisitionRequestStore.get_request_redis_id(TEST_ACQUISITION_REQ),
        str(new_req))
    return new_req
Ejemplo n.º 2
0
def stored_request_real(redis_client):
    new_req = AcquisitionRequest(**TEST_ACQUISITION_REQ_JSON)
    new_req.timestamps['VALIDATED'] = 1449523225
    redis_client.hset(
        AcquisitionRequestStore.REDIS_HASH_NAME,
        AcquisitionRequestStore.get_request_redis_id(TEST_ACQUISITION_REQ),
        str(new_req))
    return new_req
Ejemplo n.º 3
0
def test_delete(req_store_real, redis_client, stored_request_real):
    req_store_real.delete(TEST_ACQUISITION_REQ)
    assert not redis_client.hexists(
        AcquisitionRequestStore.REDIS_HASH_NAME,
        AcquisitionRequestStore.get_request_redis_id(TEST_ACQUISITION_REQ))
Ejemplo n.º 4
0
def test_put(req_store, redis_mock):
    req_store.put(TEST_ACQUISITION_REQ)
    redis_mock.hset.assert_called_with(
        AcquisitionRequestStore.REDIS_HASH_NAME,
        AcquisitionRequestStore.get_request_redis_id(TEST_ACQUISITION_REQ),
        TEST_ACQUISITION_REQ_STR)
Ejemplo n.º 5
0
def req_store(redis_mock):
    return AcquisitionRequestStore(redis_mock)
Ejemplo n.º 6
0
def test_delete(req_store_real, redis_client, stored_request_real):
    req_store_real.delete(TEST_ACQUISITION_REQ)
    assert not redis_client.hexists(
        AcquisitionRequestStore.REDIS_HASH_NAME,
        AcquisitionRequestStore.get_request_redis_id(TEST_ACQUISITION_REQ))
Ejemplo n.º 7
0
def test_put(req_store, redis_mock):
    req_store.put(TEST_ACQUISITION_REQ)
    redis_mock.hset.assert_called_with(
        AcquisitionRequestStore.REDIS_HASH_NAME,
        AcquisitionRequestStore.get_request_redis_id(TEST_ACQUISITION_REQ),
        TEST_ACQUISITION_REQ_STR)
Ejemplo n.º 8
0
def req_store_real(redis_client):
    return AcquisitionRequestStore(redis_client)