2021-05-18 19:13:57 +02:00
|
|
|
# standard imports
|
|
|
|
import json
|
|
|
|
|
|
|
|
# external imports
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
# local imports
|
|
|
|
from cic_cache.runnable.daemons.query import process_transactions_all_data
|
|
|
|
|
|
|
|
|
|
|
|
def test_api_all_data(
|
|
|
|
init_database,
|
|
|
|
txs,
|
|
|
|
):
|
|
|
|
|
|
|
|
env = {
|
2021-12-22 20:12:08 +01:00
|
|
|
'PATH_INFO': '/txa/100/0/410000/420000',
|
2021-05-18 19:13:57 +02:00
|
|
|
'HTTP_X_CIC_CACHE_MODE': 'all',
|
|
|
|
}
|
|
|
|
j = process_transactions_all_data(init_database, env)
|
|
|
|
o = json.loads(j[1])
|
|
|
|
|
|
|
|
assert len(o['data']) == 2
|
|
|
|
|
|
|
|
env = {
|
2021-12-22 20:12:08 +01:00
|
|
|
'PATH_INFO': '/txa/100/0/420000/410000',
|
2021-05-18 19:13:57 +02:00
|
|
|
'HTTP_X_CIC_CACHE_MODE': 'all',
|
|
|
|
}
|
|
|
|
|
|
|
|
with pytest.raises(ValueError):
|
|
|
|
j = process_transactions_all_data(init_database, env)
|