refactor: replace hardcoded paths with dynamic Path resolution in staking tests
All checks were successful
Python Tests / test-python (push) Successful in 2m32s
Staking Tests / test-staking-service (push) Successful in 2m17s
Staking Tests / test-staking-integration (push) Successful in 2m23s
Staking Tests / test-staking-contract (push) Successful in 1m16s
Staking Tests / run-staking-test-runner (push) Successful in 2m30s
All checks were successful
Python Tests / test-python (push) Successful in 2m32s
Staking Tests / test-staking-service (push) Successful in 2m17s
Staking Tests / test-staking-integration (push) Successful in 2m23s
Staking Tests / test-staking-contract (push) Successful in 1m16s
Staking Tests / run-staking-test-runner (push) Successful in 2m30s
- Changed from hardcoded /opt/aitbc paths to Path(__file__).resolve().parents[2] for dynamic repository root resolution - Reorganized imports to follow standard order (stdlib, third-party, local) - Removed duplicate sys import in test_staking_service.py - Extracted repo_root variable in test_staking_lifecycle.py for cleaner path construction
This commit is contained in:
@@ -3,15 +3,16 @@ Staking Service Tests
|
||||
High-priority tests for staking service functionality
|
||||
"""
|
||||
|
||||
import pytest
|
||||
import asyncio
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import pytest
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import sessionmaker, Session
|
||||
|
||||
import sys
|
||||
sys.path.insert(0, "/opt/aitbc/apps/coordinator-api/src")
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "apps/coordinator-api/src"))
|
||||
|
||||
from app.domain.bounty import AgentStake, AgentMetrics, StakingPool, StakeStatus, PerformanceTier
|
||||
from app.services.staking_service import StakingService
|
||||
|
||||
Reference in New Issue
Block a user