feat: migrate tests to use centralized aitbc package utilities
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:
aitbc
2026-04-24 21:45:18 +02:00
parent 35196e4d43
commit 9b274d4386
12 changed files with 78 additions and 68 deletions

View File

@@ -5,7 +5,7 @@ Minimal test to debug transaction import
import json
import hashlib
import requests
from aitbc import AITBCHTTPClient, NetworkError
BASE_URL = "https://aitbc.bubuit.net/rpc"
CHAIN_ID = "ait-mainnet"
@@ -19,8 +19,8 @@ def test_minimal():
"""Test with minimal data"""
# Get current head
response = requests.get(f"{BASE_URL}/head")
head = response.json()
client = AITBCHTTPClient()
head = client.get(f"{BASE_URL}/head")
# Create a new block
height = head["height"] + 1
@@ -58,9 +58,8 @@ def test_minimal():
test_block["transactions"] = [{"tx_hash": "0xtest", "sender": "0xtest", "recipient": "0xtest", "payload": {}}]
print("\nTesting with one transaction...")
response = requests.post(f"{BASE_URL}/importBlock", json=test_block)
print(f"Status: {response.status_code}")
print(f"Response: {response.json()}")
response = client.post(f"{BASE_URL}/importBlock", json=test_block)
print(f"Response: {response}")
if __name__ == "__main__":
test_minimal()