Skip to content

Commit b3b067b

Browse files
authored
AQL cache can only configured by administrator. (#97)
1 parent 119e60c commit b3b067b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎tests/test_aql.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,13 @@ async def test_query_rules(db, bad_db):
229229

230230

231231
@pytest.mark.asyncio
232-
async def test_cache_results_management(db, bad_db, doc_col, docs, cluster):
232+
async def test_cache_results_management(db, sys_db, bad_db, doc_col, docs, cluster):
233233
if cluster:
234234
pytest.skip("Cluster mode does not support query result cache management")
235235

236236
aql = db.aql
237237
cache = aql.cache
238+
sys_cache = sys_db.aql.cache
238239

239240
# Sanity check, just see if the response is OK.
240241
_ = await cache.properties()
@@ -243,7 +244,7 @@ async def test_cache_results_management(db, bad_db, doc_col, docs, cluster):
243244
assert err.value.error_code == FORBIDDEN
244245

245246
# Turn on caching
246-
result = await cache.configure(mode="on")
247+
result = await sys_cache.configure(mode="on")
247248
assert result.mode == "on"
248249
result = await cache.properties()
249250
assert result.mode == "on"
@@ -269,8 +270,8 @@ async def test_cache_results_management(db, bad_db, doc_col, docs, cluster):
269270
assert err.value.error_code == FORBIDDEN
270271

271272
# Clear the cache
272-
await cache.clear()
273-
entries = await cache.entries()
273+
await sys_cache.clear()
274+
entries = await sys_cache.entries()
274275
assert len(entries) == 0
275276
with pytest.raises(AQLCacheClearError) as err:
276277
await bad_db.aql.cache.clear()

0 commit comments

Comments
 (0)