Conversation
…s listed in a pantry JSON file, packaged as a Docker container.
🤖 Review by GROQ Agent✅ What's solid
🧪 Tests
# tests/test_recipe.py
import json
import random
import pathlib
import subprocess
import sys
from src.recipe import load_pantry, find_matching, suggest
def test_load_pantry(tmp_path):
pantry_file = tmp_path / "pantry.json"
pantry_file.write_text(json.dumps(["egg", "milk"]))
assert load_pantry(str(pantry_file)) == ["egg", "milk"]
def test_find_matching():
pantry = ["egg", "milk", "bread"]
recipes = [
{"name": "Omelette", "ingredients": ["egg", "milk"]},
{"name": "French Toast", "ingredients": ["egg", "milk", "bread"]},
{"name": "Pancakes", "ingredients": ["flour", "egg"]},
]
matches = find_matching(pantry, recipes)
assert len(matches) == 2
assert {"name": "Omelette"} in matches
assert {"name": "French Toast"} in matches
def test_suggest_deterministic():
random.seed(0) # make choice predictable
pantry = ["egg", "milk", "bread"]
suggestion = suggest(pantry)
assert suggestion["name"] in {"Omelette", "French Toast"}
def test_cli_in_docker(tmp_path):
pantry = tmp_path / "pantry.json"
pantry.write_text(json.dumps(["egg", "milk", "flour", "sugar", "butter"]))
result = subprocess.run(
["docker", "run", "--rm",
"-v", f"{pantry}:/app/pantry.json",
"pantry-suggester"],
capture_output=True, text=True, check=True
)
assert "Suggested recipe:" in result.stdoutAdding these tests will give the CI confidence that the core logic works and that the Docker image behaves as documented. 🔒 Security
🧩 Docs / DX
🧱 Mocks / Fakes
Actionable next steps
Implementing these changes will make the utility robust, secure, and maintainable while giving the CI pipeline meaningful verification. |
🤖 Review by GEMINI Agent✅ What's solid
🧪 Tests
🔒 Security
🧩 Docs/DX
🧱 Mocks/Fakes
|
Implementation Summary
docker-tools/nightly-nightly-pantry-recipe-suggesRationale
Why safe to merge
docker-tools/nightly-nightly-pantry-recipe-sugges.Test Plan
docker-tools/nightly-nightly-pantry-recipe-sugges/README.mddocker-tools/nightly-nightly-pantry-recipe-sugges/tests/Links
Mock Justification