MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / test_get_selection_stats

Method test_get_selection_stats

tests/test_db_ops.py:234–250  ·  view source on GitHub ↗

Test getting selection statistics

(self, test_db_path)

Source from the content-addressed store, hash-verified

232 """Tests for selection statistics"""
233
234 def test_get_selection_stats(self, test_db_path):
235 """Test getting selection statistics"""
236 import db_ops
237 db_ops.DB_PATH = test_db_path
238
239 # Log some behaviors
240 for i in range(5):
241 log_behavior("test_user", f"push_{i:03d}", i, "selected", "selected", "🔴")
242 for i in range(5, 10):
243 log_behavior("test_user", f"push_{i:03d}", i, "skipped", "skipped", "🟡")
244
245 # Get stats
246 stats = get_selection_stats("test_user", days=7)
247 assert stats["total"] == 10
248 assert stats["selected"] == 5
249 assert stats["skipped"] == 5
250 assert abs(stats["selection_rate"] - 0.5) < 0.01
251
252
253class TestReadingQueueOperations:

Callers

nothing calls this directly

Calls 2

log_behaviorFunction · 0.90
get_selection_statsFunction · 0.90

Tested by

no test coverage detected