Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion tests/unit/db/test_session_bridge_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async def test_insert_session_bridge_rule_writes_s1_defaults(
)

assert len(watch.rule_id) == 12
assert watch.rule_id.islower()
assert watch.rule_id == watch.rule_id.lower()
assert watch.rule_id.isalnum()
assert int(watch.rule_id, 16) >= 0
assert watch.header is True
Expand All @@ -55,6 +55,18 @@ async def test_insert_session_bridge_rule_writes_s1_defaults(
assert connect.expires_at is None


@pytest.mark.asyncio
async def test_insert_session_bridge_rule_accepts_digit_only_hex_id(
temp_db: SQLiteDatabase,
):
await temp_db.initialize()
watch = await _insert_rule(temp_db, rule_id="225823821909")

assert watch.rule_id == "225823821909"
assert watch.rule_id == watch.rule_id.lower()
assert int(watch.rule_id, 16) >= 0


@pytest.mark.asyncio
async def test_direction_unique_constraint_rejects_duplicate_edge(
temp_db: SQLiteDatabase,
Expand Down
Loading