Skip to content
Open
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
5 changes: 3 additions & 2 deletions tests/test_labeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,9 @@ def fake_call(prompt, *, backend, max_tokens=200):
monkeypatch.setattr("graphify.llm._call_llm", fake_call)
labels = label_communities(G, communities, backend="gemini", batch_size=100)

# 250 communities / 100 per batch -> 3 batches (100, 100, 50)
assert calls == [100, 100, 50]
# 250 communities / 100 per batch -> 3 batches (100, 100, 50).
# Concurrent workers may reach the backend in any order.
assert sorted(calls) == [50, 100, 100]
# And every community got a real name, none left as a placeholder.
assert all(name.startswith("Cluster ") for name in labels.values()), \
f"some communities still have placeholders: {[k for k, v in labels.items() if not v.startswith('Cluster ')][:5]}"
Expand Down