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
32 lines
844 B
Python
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
|