Test getting selection statistics
(self, test_db_path)
| 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 | |
| 253 | class TestReadingQueueOperations: |
nothing calls this directly
no test coverage detected