From c872bd2e0046f096b39e5f93fde4fa7645c6023d Mon Sep 17 00:00:00 2001 From: Robert Galop Date: Sun, 29 Nov 2026 17:23:26 -0700 Subject: [PATCH 1/2] Live suite: print the conversation test's step names and counts Co-Authored-By: Claude Fable 5.2 --- tests/live/test_live.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/live/test_live.py b/tests/live/test_live.py index 0cc6b8c..9c611ea 100644 --- a/tests/live/test_live.py +++ b/tests/live/test_live.py @@ -32,6 +32,7 @@ import json import os import re +import sys import uuid from datetime import datetime, timedelta, timezone @@ -436,6 +437,7 @@ def _alert_ok(a): def test_conversation_layer_on_real_data(frontline): """Every conversation helper against the login's own data. Compares types, counts, masking and links only.""" conv = frontline.conversations + steps = {} # step name -> a count or "ran": printed at the end, never any content me, teams = conv.me(), conv.teams() assert me.user_id and me.lines is None and all(t.location_id and t.name for t in teams) @@ -444,6 +446,7 @@ def test_conversation_layer_on_real_data(frontline): for b in briefs: _brief_ok(b) assert b.key_points == [] and b.tasks == [] # list results carry the summary fields only + steps["teams"], steps["calls"] = len(teams), len(briefs) if not briefs: pytest.skip("no calls in the last 7 days for this login") whens = [b.when for b in briefs if b.when] @@ -458,6 +461,11 @@ def test_conversation_layer_on_real_data(frontline): assert isinstance(transcript, list) and all(set(seg) <= {"time", "speaker", "name", "text"} for seg in transcript) link = conv.recording_link(first.id) assert link is None or (link.url.startswith("https://") and link.url not in repr(link)) + steps["brief"] = "ran" + steps["brief key points"], steps["brief tasks"] = len(first.key_points), len(first.tasks) + steps["brief topics"], steps["brief alerts"] = len(first.topics), len(first.alerts) + steps["transcript segments"] = len(transcript) + steps["recording link"] = "none" if link is None else "ran" # caller history needs a full number: read one with the lower-level helper and keep it in memory only raw = frontline.intelligence.search_calls(date_from=NOW - timedelta(days=7), limit=10).items @@ -467,6 +475,7 @@ def test_conversation_layer_on_real_data(frontline): assert len(history) <= 3 for b in history: _brief_ok(b) + steps["caller history"] = len(history) if number else "no full number found" alerts = conv.alerts(since=NOW - timedelta(days=14), limit=10) assert len(alerts) <= 10 @@ -480,11 +489,14 @@ def test_conversation_layer_on_real_data(frontline): _brief_ok(one.call) ref = conv.reference(one) assert (ref.kind, ref.id, ref.link) == ("alert", one.id, one.link) + steps["alerts"] = len(alerts) + steps["alert by id"] = ("ran, with call" if one.call is not None else "ran, no call") if alerts else "no alerts" with pytest.raises(ic.InvalidRequestError): conv.alerts(status="open") # the API has no status filter tasks = conv.open_tasks() assert len(tasks) <= 200 and all(isinstance(t, ic.conversations.TaskBrief) and t.id for t in tasks) + steps["open tasks"] = len(tasks) if teams: view = conv.team_view(teams[0], since=NOW - timedelta(days=2)) @@ -493,18 +505,26 @@ def test_conversation_layer_on_real_data(frontline): _brief_ok(b) for a in view.alerts: _alert_ok(a) + steps["team view"] = f"ran, {len(view.briefs)} briefs, {len(view.alerts)} alerts" + else: + steps["team view"] = "no teams" try: topics = conv.topics(since=NOW - timedelta(days=7)) except ic.ApiError as exc: # the login has no Insights Hub access assert exc.status in (403, 404) + steps["topics"] = f"refused ({exc.status})" else: assert all(isinstance(v, int) for v in topics.calls.values()) assert all({"name", "call_count"} <= set(t) for t in topics.topics) + steps["topics"] = f"ran, {len(topics.topics)} topics, {len(topics.rising)} rising" for bad in ({"since": NOW - timedelta(days=40)}, {"limit": 201}, {"day": NOW.date(), "since": NOW}): with pytest.raises(ic.InvalidRequestError): conv.calls(**bad) + steps["refused inputs"] = 4 + # Counts and step names only, straight to the terminal (pytest captures ordinary output). + print("steps: " + ", ".join(f"{k}: {v}" for k, v in steps.items()), file=sys.__stderr__) def test_frontline_calls(frontline): From 511238e473d072497f3332c9d387478a8ed263e3 Mon Sep 17 00:00:00 2001 From: Robert Galop Date: Sun, 29 Nov 2026 17:23:39 -0700 Subject: [PATCH 2/2] Live suite: plain print for the step line (shown with -s) Co-Authored-By: Claude Fable 5.2 --- tests/live/test_live.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/live/test_live.py b/tests/live/test_live.py index 9c611ea..9116c67 100644 --- a/tests/live/test_live.py +++ b/tests/live/test_live.py @@ -32,7 +32,6 @@ import json import os import re -import sys import uuid from datetime import datetime, timedelta, timezone @@ -523,8 +522,8 @@ def test_conversation_layer_on_real_data(frontline): with pytest.raises(ic.InvalidRequestError): conv.calls(**bad) steps["refused inputs"] = 4 - # Counts and step names only, straight to the terminal (pytest captures ordinary output). - print("steps: " + ", ".join(f"{k}: {v}" for k, v in steps.items()), file=sys.__stderr__) + # Counts and step names only. Run pytest with -s to see the line. + print("\nsteps: " + ", ".join(f"{k}: {v}" for k, v in steps.items())) def test_frontline_calls(frontline):