feat: agregar template base de Python con tests

This commit is contained in:
Hermes Agent 2026-09-10 22:30:44 -03:00
parent 584a4fe42b
commit 3853586abf
6 changed files with 81 additions and 0 deletions

View File

@ -1,3 +1,22 @@
# FieldTest # FieldTest
Datos: creado desde Hermes con tea CLI. Datos: creado desde Hermes con tea CLI.
## Template Python
Estructura base incluida:
- `src/fieldtest/` paquete principal
- `tests/` pruebas unitarias (unittest)
- `pyproject.toml` configuración de empaquetado
- `.gitignore` y `LICENSE`
## Uso rápido
Ejecutar pruebas:
`PYTHONPATH=src python3 -m unittest discover -s tests -v`
Ejecutar módulo:
`PYTHONPATH=src python3 -m fieldtest`

30
pyproject.toml Normal file
View File

@ -0,0 +1,30 @@
[build-system]
requires = ["setuptools>=69", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "fieldtest"
version = "0.1.0"
description = "Plantilla base de proyecto Python creada desde Hermes"
readme = "README.md"
requires-python = ">=3.10"
authors = [
{ name = "deimo72" }
]
license = { text = "MIT" }
keywords = ["template", "python", "fieldtest"]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent"
]
[tool.setuptools]
package-dir = {"" = "src"}
[tool.setuptools.packages.find]
where = ["src"]
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]

View File

@ -0,0 +1,5 @@
"""Paquete base FieldTest."""
from .core import saludar
__all__ = ["saludar"]

View File

@ -0,0 +1,9 @@
from .core import saludar
def main() -> None:
print(saludar("desde FieldTest"))
if __name__ == "__main__":
main()

3
src/fieldtest/core.py Normal file
View File

@ -0,0 +1,3 @@
def saludar(nombre: str = "mundo") -> str:
"""Retorna un saludo simple."""
return f"Hola, {nombre}!"

15
tests/test_core.py Normal file
View File

@ -0,0 +1,15 @@
import unittest
from fieldtest.core import saludar
class TestCore(unittest.TestCase):
def test_saludar_default(self):
self.assertEqual(saludar(), "Hola, mundo!")
def test_saludar_nombre(self):
self.assertEqual(saludar("Hermes"), "Hola, Hermes!")
if __name__ == "__main__":
unittest.main()