예제 #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
예제 #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
예제 #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))
예제 #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)
예제 #5
0
def req_store(redis_mock):
    return AcquisitionRequestStore(redis_mock)
예제 #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))
예제 #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)
예제 #8
0
파일: conftest.py 프로젝트: bsandyy/PyDAS
def req_store_real(redis_client):
    return AcquisitionRequestStore(redis_client)