Skip to content

Commit fdcc694

Browse files
authored
Merge pull request #54 from WorkTeam01/refactor/project-structure
refactor: reorganizar estructura del proyecto (src/, tests/, requirements.txt)
2 parents b8c1ab8 + 4e8eb73 commit fdcc694

10 files changed

Lines changed: 32 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
pip install pytest
27+
pip install -r requirements.txt
2828
2929
- name: Run tests
30-
run: pytest -v
30+
run: pytest tests/ -v

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Dependencias para desarrollo y testing
2+
pytest>=7.0.0

src/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""Paquete calculadora con GUI y CLI.
2+
3+
Módulos:
4+
calculator: Funciones matemáticas básicas
5+
gui: Interfaz gráfica con tkinter
6+
cli: Interfaz de línea de comandos
7+
"""
File renamed without changes.

main.py renamed to src/cli.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
#!/usr/bin/env python3
21
"""Archivo principal de ejemplo para el proyecto Team Practice.
32
43
Demuestra cómo usar los módulos del proyecto y cómo estructurar
54
un punto de entrada principal.
65
"""
76

8-
from calculator import add, subtract, multiply, divide, power, valor_maximo, valor_minimo, abs_value
7+
from .calculator import add, subtract, multiply, divide, power, valor_maximo, valor_minimo, abs_value
98

109
def main():
1110
"""Función principal del programa."""

gui.py renamed to src/gui.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
"""Interfaz gráfica de usuario (GUI) para la calculadora.
2+
3+
Este módulo implementa una calculadora con interfaz tkinter que incluye:
4+
- Operaciones básicas: suma, resta, multiplicación, división, potencia
5+
- Funciones científicas: valor absoluto, máximo, mínimo
6+
- Soporte para teclado y números negativos
7+
- Manejo de errores con mensajes visuales
8+
"""
19
import tkinter as tk
2-
from calculator import (add, subtract, multiply, divide, power, valor_maximo, valor_minimo, abs_value)
10+
from .calculator import (add, subtract, multiply, divide, power, valor_maximo, valor_minimo, abs_value)
311

412
class CalculatorGUI:
513
def __init__(self, root):

tests/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Suite de tests para Team Practice Calculator.
2+
3+
Tests unitarios para los módulos calculator y gui.
4+
"""

conftest.py renamed to tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"""Configuración de pytest y fixtures para tests.
2+
3+
Este módulo contiene fixtures y configuración compartida para todos los tests.
4+
Incluye mocks de componentes tkinter para ejecutar tests sin interfaz gráfica.
5+
"""
16
import pytest
27
import tkinter as tk
38

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import pytest
88

9-
from calculator import add, subtract, multiply, divide, power, valor_maximo, valor_minimo, abs_value
9+
from src.calculator import add, subtract, multiply, divide, power, valor_maximo, valor_minimo, abs_value
1010

1111

1212
def test_add():
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Para correr los tests: pytest test_gui_calculator.py -v
55
"""
66
import tkinter as tk
7-
from gui import CalculatorGUI
7+
from src.gui import CalculatorGUI
88

99

1010
# ============================================================================

0 commit comments

Comments
 (0)