Implement coffee machine core for MIL-002

Add the menu, coin values, starting resources and message texts to
constants.py. Implement report, is_resource_sufficient, process_coins,
is_transaction_successful, make_coffee and the main loop. Money is
counted in whole cents. The smoke test now feeds "off" so the loop
exits.

Closes #6
Closes #7
Closes #8
Closes #9
Closes #10
Closes #11
Closes #12

Task: MIL-002#1
Task: MIL-002#2
Task: MIL-002#3
Task: MIL-002#4
Task: MIL-002#5
Task: MIL-002#6
Task: MIL-002#7
This commit is contained in:
2026-10-06 19:49:49 +08:00
parent 0f26d8d91e
commit d570489a33
3 changed files with 185 additions and 8 deletions
+5 -2
View File
@@ -3,11 +3,14 @@
@brief Smoke test that the package imports.
"""
import pytest
from coffee_machine import main as main_module
def test_main_is_callable() -> None:
def test_main_is_callable(monkeypatch: pytest.MonkeyPatch) -> None:
"""!
@brief The entry point runs without error.
@brief The entry point starts and stops on "off".
"""
monkeypatch.setattr("builtins.input", lambda _prompt: "off")
main_module.main()