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:
+5
-2
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user