File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 22import pytest
33
44import pythclient .pythaccounts
5+ from pythclient .exceptions import NotLoadedException
56from pythclient .solana import SolanaPublicKey , SolanaClient
67from 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"
You can’t perform that action at this time.
0 commit comments