feat(kevin_bridge): exit-scan daily job + cursor + audit writer
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was canceled
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was canceled
This commit is contained in:
parent
a417cae77b
commit
cff2564428
6 changed files with 480 additions and 0 deletions
27
tests/services/kevin_signal_bridge/test_cursor.py
Normal file
27
tests/services/kevin_signal_bridge/test_cursor.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
"""Tests for the Redis cursor."""
|
||||
|
||||
import fakeredis.aioredis
|
||||
|
||||
from services.kevin_signal_bridge.cursor import RedisCursor
|
||||
|
||||
|
||||
async def _redis():
|
||||
return fakeredis.aioredis.FakeRedis()
|
||||
|
||||
|
||||
async def test_cursor_defaults_to_zero():
|
||||
cursor = RedisCursor(await _redis())
|
||||
assert await cursor.last_seen_id() == 0
|
||||
|
||||
|
||||
async def test_cursor_advance_persists_value():
|
||||
cursor = RedisCursor(await _redis())
|
||||
await cursor.advance(42)
|
||||
assert await cursor.last_seen_id() == 42
|
||||
|
||||
|
||||
async def test_cursor_advance_never_goes_backwards():
|
||||
cursor = RedisCursor(await _redis())
|
||||
await cursor.advance(42)
|
||||
await cursor.advance(10)
|
||||
assert await cursor.last_seen_id() == 42
|
||||
Loading…
Add table
Add a link
Reference in a new issue