from daylight_left.cli import main from daylight_left.spots import Spot, spots_that_fit ARGS = ["--lat", "42.50", "--lon", "-90.66", "--tz", "America/Chicago", "--spots", "examples/spots.txt", "--no-llm"] def test_spots_that_fit_orders_longest_stay_first(): spots = [Spot("a", 5, 15, "x"), Spot("b", 10, 45, "y"), Spot("c", 30, 60, "z")] assert [s.name for s in spots_that_fit(spots, 70)] == ["b", "a"] def test_afternoon_card_picks_a_spot(capsys): main(ARGS + ["--now", "2026-10-05T16:30"]) out = capsys.readouterr().out assert "GO: Riverside trail loop" in out assert "leave by" in out def test_after_sunset_says_tomorrow(capsys): main(ARGS + ["--now", "2026-10-05T19:30"]) assert "light's gone" in capsys.readouterr().out