Skip to content

Commit 3cd14e6

Browse files
author
Jeff Schroeder
committed
Some PythProductAccount test updates
1 parent df4988b commit 3cd14e6

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

tests/test_product_account.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
import pytest
33

44
import pythclient.pythaccounts
5+
from pythclient.exceptions import NotLoadedException
56
from pythclient.solana import SolanaPublicKey, SolanaClient
67
from pythclient.pythaccounts import (
7-
PythProductAccount,
88
_VERSION_2,
9+
PythPriceAccount,
10+
PythProductAccount,
911
_read_attribute_string,
1012
)
1113

@@ -123,3 +125,20 @@ def test_human_readable(func, product_account):
123125
"PythProductAccount BCH/USD (5uKdRzB3FzdmwyCHrqSGq4u2URja617jqtKkM71BVrkw)"
124126
)
125127
assert func(product_account) == expected
128+
129+
130+
def test_prices_property_not_loaded(product_account):
131+
with pytest.raises(NotLoadedException):
132+
product_account.prices
133+
134+
135+
def test_symbol_property(product_account):
136+
assert product_account.symbol == "BCH/USD"
137+
138+
139+
def test_symbol_property_unknown(product_account, solana_client):
140+
actual = PythProductAccount(
141+
key=product_account.key,
142+
solana=solana_client,
143+
)
144+
assert actual.symbol == "Unknown"

0 commit comments

Comments
 (0)