fix tests
This commit is contained in:
@@ -511,10 +511,12 @@ def test_proxy_chat_splits_payout_by_tracker_assigned_route_span():
|
||||
tracker_url = f"http://127.0.0.1:{port}"
|
||||
head = _UsageStubNode(total_tokens=1000)
|
||||
head_port = head.start()
|
||||
tail = _UsageStubNode(total_tokens=1000)
|
||||
tail_port = tail.start()
|
||||
try:
|
||||
for endpoint, wallet, vram, bench in (
|
||||
(f"http://127.0.0.1:{head_port}", "wallet-head", 5_000, 2.0),
|
||||
("http://127.0.0.1:1", "wallet-tail", 10_000, 1.0),
|
||||
for endpoint, wallet, vram, bench, shard_start, shard_end in (
|
||||
(f"http://127.0.0.1:{head_port}", "wallet-head", 5_000, 2.0, 0, 3),
|
||||
(f"http://127.0.0.1:{tail_port}", "wallet-tail", 10_000, 1.0, 4, 11),
|
||||
):
|
||||
reg = json.dumps({
|
||||
"endpoint": endpoint,
|
||||
@@ -528,8 +530,8 @@ def test_proxy_chat_splits_payout_by_tracker_assigned_route_span():
|
||||
"tracker_mode": endpoint.endswith(str(head_port)),
|
||||
"wallet_address": wallet,
|
||||
"managed_assignment": True,
|
||||
"shard_start": 0,
|
||||
"shard_end": 999,
|
||||
"shard_start": shard_start,
|
||||
"shard_end": shard_end,
|
||||
}).encode()
|
||||
req = urllib.request.Request(
|
||||
f"{tracker_url}/v1/nodes/register",
|
||||
@@ -547,6 +549,7 @@ def test_proxy_chat_splits_payout_by_tracker_assigned_route_span():
|
||||
assert ledger.get_node_pending("wallet-tail") == pytest.approx(pool * 8 / 12)
|
||||
finally:
|
||||
head.stop()
|
||||
tail.stop()
|
||||
tracker.stop()
|
||||
|
||||
|
||||
@@ -628,7 +631,7 @@ def test_proxy_chat_records_validation_event_with_plain_route_metadata():
|
||||
|
||||
class FakeRegistry:
|
||||
def get_wallet(self, wallet_address):
|
||||
return type("Wallet", (), {"banned": False})()
|
||||
return type("Wallet", (), {"banned": False, "reputation": 1.0})()
|
||||
|
||||
class FakeValidation:
|
||||
def __init__(self):
|
||||
|
||||
Reference in New Issue
Block a user