mirror of
https://github.com/BigBodyCobain/Shadowbroker.git
synced 2026-08-18 08:27:18 +02:00
Add gate adapter snapshot consistency regressions
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
"""Regression coverage for consistent gate-adapter chain snapshots."""
|
||||
|
||||
from services.infonet.adapters.gate_adapter import InfonetGateAdapter
|
||||
|
||||
|
||||
def _counting_adapter():
|
||||
calls = {"count": 0}
|
||||
|
||||
def chain_provider():
|
||||
calls["count"] += 1
|
||||
return []
|
||||
|
||||
return InfonetGateAdapter(chain_provider), calls
|
||||
|
||||
|
||||
def test_suspension_state_samples_chain_once():
|
||||
adapter, calls = _counting_adapter()
|
||||
|
||||
adapter.suspension_state("never-seen")
|
||||
|
||||
assert calls["count"] == 1
|
||||
|
||||
|
||||
def test_shutdown_state_samples_chain_once():
|
||||
adapter, calls = _counting_adapter()
|
||||
|
||||
adapter.shutdown_state("never-seen")
|
||||
|
||||
assert calls["count"] == 1
|
||||
Reference in New Issue
Block a user