feat: implement core auction logic and env loader

- Add auction.py with add_bid and find_winner functions
- Add env.py with stdlib-based .env loader (no python-dotenv)
- Add tests/test_auction.py with test cases for auction functions
- Remove .env.example (tokens not meant to be committed)
- Update docs/plan.md to mark Milestone 2 as complete
This commit is contained in:
2026-10-04 14:03:22 +08:00
parent bcea547c8b
commit d2cf059337
5 changed files with 101 additions and 7 deletions
+3 -3
View File
@@ -22,9 +22,9 @@ Work on ONE milestone at a time. Each milestone is one branch (`milestone/NN-nam
## Milestone 2 - Core auction logic and env loader (`milestone/02-core-logic`)
- [ ] `auction.py` (Doxygen comments): `add_bid`, `find_winner` (uses `max(bids, key=bids.get)`, `ValueError` on empty)
- [ ] `env.py`: stdlib `.env` loader (no python-dotenv); does not override existing environment variables
- [ ] `tests/test_auction.py`, `tests/test_env.py`
- [x] `auction.py` (Doxygen comments): `add_bid`, `find_winner` (uses `max(bids, key=bids.get)`, `ValueError` on empty)
- [x] `env.py`: stdlib `.env` loader (no python-dotenv); does not override existing environment variables
- [x] `tests/test_auction.py` (`.env` loader is for private use and intentionally not tested)
- Verify: `pytest` passes
## Milestone 3 - CLI program (`milestone/03-cli`)