"""Unit tests for the Peloton config.""" from datetime import datetime from feed_ingestion.flows.peloton import config def test_feed_identifiers(): """The feed name, secrets path and staging_raw table are as expected.""" assert config.feed_name == 'peloton' assert config.secrets_path == 'swf-peloton' assert config.staging_raw_table == 'staging_raw_peloton_monthly' def test_sme_drop_location(): """The files are picked up from the SME monthly drop location.""" assert config.drop_bucket == 'sme-ca-prod-partners' assert config.drop_path == 'peloton/in/monthly/' def test_countries(): """The monthly delivery covers the expected set of countries.""" assert config.countries == ['AT', 'AU', 'CA', 'DE', 'GB', 'US'] def test_filename_template_formats_country_and_month(): """The filename template fills in the country and reporting month range.""" name = config.drop_filename.format( country='US', first_day=datetime(2026, 5, 1), last_day=datetime(2026, 5, 31)) assert name == 'PMY5_M_US_20260501_20260531.txt'