test: trim purge-identity tests to behaviour invariants

Drop the three cases that pin trivia the invariant tests already cover
(idempotence is exercised by the routing-store test; the empty-name /
no-store guard and the default-profile refusal are one-line argument
checks). Salvage bar: invariants only.
This commit is contained in:
teknium1
2026-09-16 11:53:23 -07:00
committed by Teknium
parent aa90c01e9a
commit ba8b458c5b
3 changed files with 0 additions and 21 deletions

View File

@@ -121,11 +121,3 @@ def test_purge_verb_drops_routing_identity_and_reports_ok(tmp_path):
"SELECT COUNT(*) AS n FROM gateway_heartbeats WHERE profile = ?", ("gone",))["n"] == 0
finally:
db.close()
def test_purge_verb_refuses_without_a_name_or_store():
"""A malformed request or a gateway with no store answers failure — never a silent success."""
from gateway.run_profile_reconcile import purge_profile_identity_verb
no_store = purge_profile_identity_verb(SimpleNamespace(session_store=None))
assert no_store({})["ok"] is False
assert no_store({"name": "gone"})["ok"] is False

View File

@@ -53,12 +53,6 @@ def test_purge_identity_exits_nonzero_when_settlement_stays_pending(
assert "hermes profile purge-identity gone" in capsys.readouterr().err
def test_purge_identity_rejects_the_default_profile(profile_env, capsys):
with pytest.raises(SystemExit):
profile_cmd.cmd_profile(Namespace(profile_action="purge-identity", profile_name="default"))
assert "named profiles only" in capsys.readouterr().out
def test_purge_identity_refuses_a_same_name_profile_created_after_the_delete(profile_env, capsys):
"""The retry must not purge identity out from under a profile that exists again.

View File

@@ -150,10 +150,3 @@ class TestPurgeProfileState:
routing = db.load_gateway_routing_entries(scope="/root/sessions")
assert "agent:foo_bar:feishu:dm:chatA" not in routing
assert "agent:fooXbar:feishu:dm:chatB" in routing
def test_purge_is_idempotent(self, db):
db.register_backend_heartbeat(
backend_id="be1", pid=1, started_at=time.time(), profile="gone", host="h")
assert db.purge_profile_state("gone")["gateway_heartbeats"] == 1
assert db.purge_profile_state("gone")["gateway_heartbeats"] == 0