From 86fe2f72019aa953aa68d63b2e2781e7628148ee Mon Sep 17 00:00:00 2001 From: AlexeerCT Date: Tue, 3 Mar 2026 08:46:56 -0600 Subject: [PATCH] chore: Remove unused test files for debug and user info --- backend/test_debug.py | 44 --------------------------------------- backend/test_user_info.py | 39 ---------------------------------- 2 files changed, 83 deletions(-) delete mode 100644 backend/test_debug.py delete mode 100644 backend/test_user_info.py diff --git a/backend/test_debug.py b/backend/test_debug.py deleted file mode 100644 index cfb342be..00000000 --- a/backend/test_debug.py +++ /dev/null @@ -1,44 +0,0 @@ -import sys -import os -sys.path.append('/app') -sys.path.append('/home/josmar/dev/anexo76/backend') - -from sqlalchemy import create_engine -from sqlalchemy.orm import sessionmaker -import asyncio -import logging - -# Disable logging to keep output clean -logging.basicConfig(level=logging.ERROR) - -from api.v1.modules.a76.general_catalogs.fractions.tariff_fractions.service import TariffFractionService -from api.v1.modules.a76.general_catalogs.fractions.tariff_fractions.dto import TariffFractionResponseDTO - -async def test(): - # Use the database URL from the environment or default - db_url = "postgresql://postgres:postgres@anexo76-postgres-a76:5432/anexo76_core" - engine = create_engine(db_url) - Session = sessionmaker(bind=engine) - db = Session() - - try: - print("Starting test for catalog='american'...") - items, total = await TariffFractionService.get_all( - db, skip=0, limit=10, filters=None, catalog="american", tenant_id=1, company_id=1 - ) - print(f"Service Success! Total: {total}") - - print("Validating items with TariffFractionResponseDTO...") - for item in items: - dto = TariffFractionResponseDTO.model_validate(item) - print(f"DTO: ID={dto.id}, Code={dto.code}, Fraction={dto.fraction}") - - except Exception as e: - print(f"Error caught: {type(e).__name__}: {e}") - import traceback - traceback.print_exc() - finally: - db.close() - -if __name__ == "__main__": - asyncio.run(test()) diff --git a/backend/test_user_info.py b/backend/test_user_info.py deleted file mode 100644 index 17f2cc2b..00000000 --- a/backend/test_user_info.py +++ /dev/null @@ -1,39 +0,0 @@ -import sys -import os -sys.path.append('/app') -sys.path.append('/home/josmar/dev/anexo76/backend') - -from sqlalchemy import create_engine, text -from sqlalchemy.orm import sessionmaker - -def test(): - db_url = "postgresql://postgres:postgres@anexo76-postgres-a76:5432/anexo76_core" - engine = create_engine(db_url) - Session = sessionmaker(bind=engine) - db = Session() - - try: - print("Checking users and tenants...") - # Check users - users = db.execute(text("SELECT id, email, tenant_id FROM a76.users")).fetchall() - for u in users: - print(f"User ID: {u.id} | Email: {u.email} | Tenant ID: {u.tenant_id}") - - # Check companies - companies = db.execute(text("SELECT id, name, tenant_id FROM a76.companies")).fetchall() - for c in companies: - print(f"Company ID: {c.id} | Name: {c.name} | Tenant ID: {c.tenant_id}") - - # Check fractions - fractions = db.execute(text("SELECT id, code, tenant_id, company_id FROM a76.us_tariff_fractions")).fetchall() - print(f"Total US Fractions in DB: {len(fractions)}") - for f in fractions: - print(f"Fraction ID: {f.id} | Code: {f.code} | Tenant ID: {f.tenant_id} | Company ID: {f.company_id}") - - except Exception as e: - print(f"Error: {e}") - finally: - db.close() - -if __name__ == "__main__": - test()