Set up the Blackjack project foundation for gateway MIL-001. - pyproject.toml: Python >=3.13, src layout, no runtime dependencies, optional dev extras (ruff, mypy, pytest) and their configuration - src/blackjack/: package with constants.py (deck, scoring thresholds, emoji card faces) and Doxygen-style docstrings - tests/test_package.py: smoke tests for the package and its constants - Doxyfile: reads src/, writes HTML to docs/doxygen/ - README.md: venv setup with pip upgrade, run, test, lint and Doxygen instructions - .gitignore: ignore generated docs/doxygen/ The repository description and topics were set on the git host through its API (no file change). Closes #1 Closes #2 Closes #3 Closes #4 Closes #5 Closes #6 Task: MIL-001#1 Task: MIL-001#2 Task: MIL-001#3 Task: MIL-001#4 Task: MIL-001#5 Task: MIL-001#6
39 lines
979 B
Python
39 lines
979 B
Python
"""!
|
|
@file test_package.py
|
|
@brief Smoke tests: the package imports and its constants match the house rules.
|
|
"""
|
|
|
|
import unittest
|
|
|
|
import blackjack
|
|
from blackjack import constants
|
|
|
|
|
|
class TestPackage(unittest.TestCase):
|
|
"""!
|
|
@brief Checks that the package and its constants load.
|
|
"""
|
|
|
|
def test_package_has_version(self) -> None:
|
|
"""!
|
|
@brief The package exposes a version string.
|
|
"""
|
|
self.assertTrue(blackjack.__version__)
|
|
|
|
def test_deck_matches_house_rules(self) -> None:
|
|
"""!
|
|
@brief The deck is the 13-card list from the assignment.
|
|
"""
|
|
self.assertEqual(constants.CARDS, [11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10])
|
|
|
|
def test_every_card_has_an_emoji_face(self) -> None:
|
|
"""!
|
|
@brief Every card in the deck can be rendered.
|
|
"""
|
|
for card in constants.CARDS:
|
|
self.assertIn(card, constants.CARD_FACES)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|