@@ -39,39 +39,39 @@ def test_auth_login_response_structure(self):
3939
4040 # Required fields
4141 assert "jwt" in hints
42- assert hints ["jwt" ] == str
42+ assert hints ["jwt" ] is str
4343 assert "expiresIn" in hints
44- assert hints ["expiresIn" ] == int
44+ assert hints ["expiresIn" ] is int
4545 assert "accountId" in hints
46- assert hints ["accountId" ] == int
46+ assert hints ["accountId" ] is int
4747
4848 def test_account_response_structure (self ):
4949 """Test AccountResponse has correct fields."""
5050 hints = get_type_hints (AccountResponse , include_extras = True )
5151
5252 assert "id" in hints
53- assert hints ["id" ] == int
53+ assert hints ["id" ] is int
5454 assert "name" in hints
55- assert hints ["name" ] == str
55+ assert hints ["name" ] is str
5656 assert "balance" in hints
57- assert hints ["balance" ] == float
57+ assert hints ["balance" ] is float
5858 assert "canTrade" in hints
59- assert hints ["canTrade" ] == bool
59+ assert hints ["canTrade" ] is bool
6060
6161 def test_instrument_response_structure (self ):
6262 """Test InstrumentResponse has correct fields."""
6363 hints = get_type_hints (InstrumentResponse , include_extras = True )
6464
6565 # Required fields
6666 assert "id" in hints
67- assert hints ["id" ] == str
67+ assert hints ["id" ] is str
6868 assert "name" in hints
6969 assert "tickSize" in hints
70- assert hints ["tickSize" ] == float
70+ assert hints ["tickSize" ] is float
7171 assert "tickValue" in hints
72- assert hints ["tickValue" ] == float
72+ assert hints ["tickValue" ] is float
7373 assert "activeContract" in hints
74- assert hints ["activeContract" ] == bool
74+ assert hints ["activeContract" ] is bool
7575
7676 # Optional fields should be NotRequired
7777 assert "symbolId" in hints
@@ -83,18 +83,18 @@ def test_order_response_structure(self):
8383
8484 # Core fields
8585 assert "id" in hints
86- assert hints ["id" ] == int
86+ assert hints ["id" ] is int
8787 assert "accountId" in hints
8888 assert "contractId" in hints
89- assert hints ["contractId" ] == str
89+ assert hints ["contractId" ] is str
9090 assert "status" in hints
91- assert hints ["status" ] == int
91+ assert hints ["status" ] is int
9292 assert "type" in hints
93- assert hints ["type" ] == int
93+ assert hints ["type" ] is int
9494 assert "side" in hints
95- assert hints ["side" ] == int
95+ assert hints ["side" ] is int
9696 assert "size" in hints
97- assert hints ["size" ] == int
97+ assert hints ["size" ] is int
9898
9999 # Optional price fields
100100 assert "limitPrice" in hints
@@ -106,30 +106,30 @@ def test_position_response_structure(self):
106106 hints = get_type_hints (PositionResponse , include_extras = True )
107107
108108 assert "id" in hints
109- assert hints ["id" ] == int
109+ assert hints ["id" ] is int
110110 assert "accountId" in hints
111111 assert "contractId" in hints
112112 assert "type" in hints
113- assert hints ["type" ] == int # 0=UNDEFINED, 1=LONG, 2=SHORT
113+ assert hints ["type" ] is int # 0=UNDEFINED, 1=LONG, 2=SHORT
114114 assert "size" in hints
115- assert hints ["size" ] == int
115+ assert hints ["size" ] is int
116116 assert "averagePrice" in hints
117- assert hints ["averagePrice" ] == float
117+ assert hints ["averagePrice" ] is float
118118
119119 def test_trade_response_structure (self ):
120120 """Test TradeResponse has correct fields."""
121121 hints = get_type_hints (TradeResponse , include_extras = True )
122122
123123 assert "id" in hints
124- assert hints ["id" ] == int
124+ assert hints ["id" ] is int
125125 assert "price" in hints
126- assert hints ["price" ] == float
126+ assert hints ["price" ] is float
127127 assert "size" in hints
128- assert hints ["size" ] == int
128+ assert hints ["size" ] is int
129129 assert "side" in hints
130- assert hints ["side" ] == int
130+ assert hints ["side" ] is int
131131 assert "fees" in hints
132- assert hints ["fees" ] == float
132+ assert hints ["fees" ] is float
133133
134134 # Optional P&L (None for half-turn trades)
135135 assert "profitAndLoss" in hints
@@ -140,41 +140,41 @@ def test_bar_data_structure(self):
140140
141141 # OHLCV fields
142142 assert "timestamp" in hints
143- assert hints ["timestamp" ] == str
143+ assert hints ["timestamp" ] is str
144144 assert "open" in hints
145- assert hints ["open" ] == float
145+ assert hints ["open" ] is float
146146 assert "high" in hints
147- assert hints ["high" ] == float
147+ assert hints ["high" ] is float
148148 assert "low" in hints
149- assert hints ["low" ] == float
149+ assert hints ["low" ] is float
150150 assert "close" in hints
151- assert hints ["close" ] == float
151+ assert hints ["close" ] is float
152152 assert "volume" in hints
153- assert hints ["volume" ] == int
153+ assert hints ["volume" ] is int
154154
155155 def test_quote_data_structure (self ):
156156 """Test QuoteData market quote structure."""
157157 hints = get_type_hints (QuoteData , include_extras = True )
158158
159159 assert "contractId" in hints
160- assert hints ["contractId" ] == str
160+ assert hints ["contractId" ] is str
161161 assert "bid" in hints
162- assert hints ["bid" ] == float
162+ assert hints ["bid" ] is float
163163 assert "bidSize" in hints
164- assert hints ["bidSize" ] == int
164+ assert hints ["bidSize" ] is int
165165 assert "ask" in hints
166- assert hints ["ask" ] == float
166+ assert hints ["ask" ] is float
167167 assert "askSize" in hints
168- assert hints ["askSize" ] == int
168+ assert hints ["askSize" ] is int
169169
170170 def test_market_depth_level_structure (self ):
171171 """Test MarketDepthLevel structure."""
172172 hints = get_type_hints (MarketDepthLevel , include_extras = True )
173173
174174 assert "price" in hints
175- assert hints ["price" ] == float
175+ assert hints ["price" ] is float
176176 assert "size" in hints
177- assert hints ["size" ] == int
177+ assert hints ["size" ] is int
178178 assert "orders" in hints # Optional
179179
180180 def test_websocket_payload_structures (self ):
@@ -229,9 +229,9 @@ def test_error_response_structure(self):
229229 hints = get_type_hints (ErrorResponse , include_extras = True )
230230
231231 assert "errorCode" in hints
232- assert hints ["errorCode" ] == int
232+ assert hints ["errorCode" ] is int
233233 assert "errorMessage" in hints
234- assert hints ["errorMessage" ] == str
234+ assert hints ["errorMessage" ] is str
235235 assert "details" in hints # Optional
236236
237237 def test_real_world_response_creation (self ):
0 commit comments