daylight-left: offline sunset + spot picker with local Gemma 3 1B nudge (HF26 Week 1: Touch Grass)
3e53af9 Download tests/test_cli.py from maddiebrooks208/daylight-left: direct link, hf CLI and curl.
- Browser
- Download file 764 Bytes
-
https://huggingface.co/maddiebrooks208/daylight-left/resolve/main/tests/test_cli.py
- Command line
-
hf download hf://maddiebrooks208/daylight-left/tests/test_cli.py
-
curl -L -o test_cli.py https://huggingface.co/maddiebrooks208/daylight-left/resolve/main/tests/test_cli.py
764 Bytes
| 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 | |