Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 235303b

Browse files
authoredFeb 12, 2025
fix: update tests after changing fixtures (#60)
1 parent 65c2d92 commit 235303b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed
 

‎tests/test_price_account.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from pythclient.pythaccounts import (
66
ACCOUNT_HEADER_BYTES,
7-
DEFAULT_MAX_LATENCY,
87
PythPriceAccount,
98
PythPriceType,
109
PythPriceStatus,
@@ -14,7 +13,7 @@
1413

1514

1615
# Yes, this sucks, but it is actually a monster datastructure
17-
# Equity.US.AAPL/USD symbol
16+
# Equity.US.AAPL/USD symbol with a max latency of 50 slots
1817
@pytest.fixture
1918
def price_account_bytes():
2019
return base64.b64decode((
@@ -316,15 +315,15 @@ def test_price_account_agregate_conf_interval(
316315
):
317316
price_account.update_from(buffer=price_account_bytes, version=2, offset=ACCOUNT_HEADER_BYTES)
318317
price_account.slot = price_account.aggregate_price_info.pub_slot
319-
assert price_account.aggregate_price_confidence_interval == 0.366305
318+
assert price_account.aggregate_price_confidence_interval == 0.14454
320319

321320

322321
def test_price_account_agregate_price(
323322
price_account_bytes: bytes, price_account: PythPriceAccount,
324323
):
325324
price_account.update_from(buffer=price_account_bytes, version=2, offset=ACCOUNT_HEADER_BYTES)
326325
price_account.slot = price_account.aggregate_price_info.pub_slot
327-
assert price_account.aggregate_price == 707.125
326+
assert price_account.aggregate_price == 236.23373
328327

329328
def test_price_account_unknown_status(
330329
price_account_bytes: bytes, price_account: PythPriceAccount,
@@ -340,7 +339,7 @@ def test_price_account_get_aggregate_price_status_still_trading(
340339
price_account_bytes: bytes, price_account: PythPriceAccount
341340
):
342341
price_account.update_from(buffer=price_account_bytes, version=2, offset=ACCOUNT_HEADER_BYTES)
343-
price_account.slot = price_account.aggregate_price_info.pub_slot + DEFAULT_MAX_LATENCY
342+
price_account.slot = price_account.aggregate_price_info.pub_slot + 50
344343

345344
price_status = price_account.aggregate_price_status
346345
assert price_status == PythPriceStatus.TRADING
@@ -349,7 +348,7 @@ def test_price_account_get_aggregate_price_status_got_stale(
349348
price_account_bytes: bytes, price_account: PythPriceAccount
350349
):
351350
price_account.update_from(buffer=price_account_bytes, version=2, offset=ACCOUNT_HEADER_BYTES)
352-
price_account.slot = price_account.aggregate_price_info.pub_slot + DEFAULT_MAX_LATENCY + 1
351+
price_account.slot = price_account.aggregate_price_info.pub_slot + 50 + 1
353352

354353
price_status = price_account.aggregate_price_status
355354
assert price_status == PythPriceStatus.UNKNOWN

0 commit comments

Comments
 (0)
Please sign in to comment.