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

Class TestSelectionStats

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

Tests for selection statistics

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected