AtAnyRate/tests/test_log.py
ilia c8a82e264c Add tests, geo search, noise filtering, sports scoring, and dedup improvements.
Tests cover providers, dedup, Telegram, scoring, main runner, and Airbnb stubs.
Ticketmaster and SeatGeek use configurable lat/lon/radius (Thornhill default).
Pipeline filters noise listings, merges same-day sports duplicates, optional
MIN_ALERT_SCORE, and Telegram severity summary.

Made-with: Cursor
2026-04-04 15:25:35 -04:00

32 lines
844 B
Python

"""Tests for the logging setup module."""
import logging
from src.log import setup_logging
class TestSetupLogging:
def test_sets_root_level(self):
setup_logging("DEBUG")
root = logging.getLogger()
assert root.level == logging.DEBUG
def test_adds_handler(self):
root = logging.getLogger()
root.handlers.clear()
setup_logging("INFO")
assert len(root.handlers) >= 1
def test_no_duplicate_handlers(self):
root = logging.getLogger()
root.handlers.clear()
setup_logging("INFO")
count = len(root.handlers)
setup_logging("INFO")
assert len(root.handlers) == count
def test_invalid_level_defaults_to_info(self):
setup_logging("NONEXISTENT")
root = logging.getLogger()
assert root.level == logging.INFO