feat: migrate tests to use centralized aitbc package utilities
Some checks failed
Python Tests / test-python (push) Failing after 43s
Some checks failed
Python Tests / test-python (push) Failing after 43s
- Migrate HTTP client usage from requests to aitbc.AITBCHTTPClient in test files - Update conftest.py to use aitbc path utilities (get_data_path, get_log_path) - Update test_model_validation.py to use aitbc validators (validate_address, validate_hash) - Skip HTML scraping files that require raw requests (verify_toggle_removed.py) - Migrated files: test_payment_integration.py, test_cross_node_blockchain.py, verify_transactions_fixed.py, test_tx_import.py, test_simple_import.py, test_minimal.py, test_block_import_complete.py
This commit is contained in:
@@ -12,6 +12,12 @@ from unittest.mock import Mock
|
||||
project_root = Path(__file__).parent.parent
|
||||
sys.path.insert(0, str(project_root))
|
||||
|
||||
# Add aitbc package to sys.path for centralized utilities
|
||||
sys.path.insert(0, str(project_root / "aitbc"))
|
||||
|
||||
# Import aitbc utilities for conftest
|
||||
from aitbc import get_data_path, get_log_path
|
||||
|
||||
# Add necessary source paths
|
||||
sys.path.insert(0, str(project_root / "packages" / "py" / "aitbc-core" / "src"))
|
||||
sys.path.insert(0, str(project_root / "packages" / "py" / "aitbc-crypto" / "src"))
|
||||
@@ -44,8 +50,9 @@ sys.path.insert(0, str(project_root / "apps" / "coordinator-api"))
|
||||
|
||||
# Set up test environment
|
||||
os.environ["TEST_MODE"] = "true"
|
||||
os.environ["AUDIT_LOG_DIR"] = str(project_root / "logs" / "audit")
|
||||
os.environ["AUDIT_LOG_DIR"] = str(get_log_path() / "audit")
|
||||
os.environ["TEST_DATABASE_URL"] = "sqlite:///:memory:"
|
||||
os.environ["DATA_DIR"] = str(get_data_path())
|
||||
|
||||
# Mock missing optional dependencies
|
||||
sys.modules['slowapi'] = Mock()
|
||||
|
||||
Reference in New Issue
Block a user