Files
qtalker---/backend/tests/test_telemetry.py
Indiana b9110f45de feat: spirit engine — seance WS, entity minting/Codex, Piper TTS voices, wire telemetry
- WS /ws/session: modes, summon, anomaly fragments, streaming direct contact,
  passive wire-ghost ambient loop, per-user rate limits, event transcript
- entities: anomaly-signature fingerprinting, LLM minting + procedural
  fallback, Codex matching with contact counts and sightings
- tts: 8 local Piper voices (EN/ES), per-entity voice profiles, numpy
  effects chain (pitch/rate/bitcrush/echo/static)
- llm: streaming client, submit_stream in bounded queue, SpiritService
  with offline fallbacks for every channel
- routes: public /api/codex, /api/codex/{id}, /api/stats; /audio static mount
- models: Entity, EntitySighting, Event, ContactSession(entity_id, language)
2026-07-20 20:13:28 +00:00

20 lines
835 B
Python

from app.telemetry import parse_proc_net_dev
PROC_NET_DEV = """Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo: 1234567 1000 0 0 0 0 0 0 1234567 1000 0 0 0 0 0 0
eth0: 9876543 5000 0 0 0 0 0 0 1111111 4000 0 0 0 0 0 0
"""
def test_parse_proc_net_dev_extracts_counters():
counters = parse_proc_net_dev(PROC_NET_DEV)
assert counters == {
"lo": (1234567, 1234567),
"eth0": (9876543, 1111111),
}
def test_parse_proc_net_dev_ignores_malformed_lines():
assert parse_proc_net_dev("garbage\nno colon here\n") == {}