Skip to content

Commit 39f5047

Browse files
Pigbibicodex
andcommitted
test: use non-production IBKR portfolio fixture
Co-Authored-By: Codex <noreply@openai.com>
1 parent 43a88b6 commit 39f5047

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

tests/test_ibkr_portfolio.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ def positions(self):
8181

8282
def accountValues(self):
8383
return [
84-
SimpleNamespace(account="U16608560", currency="USD", tag="NetLiquidation", value="1130"),
85-
SimpleNamespace(account="U16608560", currency="USD", tag="AvailableFunds", value="885.99"),
86-
SimpleNamespace(account="U16608560", currency="USD", tag="CashBalance", value="477.10"),
87-
SimpleNamespace(account="U16608560", currency="HKD", tag="CashBalance", value="408.98"),
84+
SimpleNamespace(account="U00000000", currency="USD", tag="NetLiquidation", value="1130"),
85+
SimpleNamespace(account="U00000000", currency="USD", tag="AvailableFunds", value="885.99"),
86+
SimpleNamespace(account="U00000000", currency="USD", tag="CashBalance", value="477.10"),
87+
SimpleNamespace(account="U00000000", currency="HKD", tag="CashBalance", value="408.98"),
8888
]
8989

9090
snapshot = fetch_portfolio_snapshot(
9191
MultiCurrencyIB(),
92-
account_ids=("U16608560",),
92+
account_ids=("U00000000",),
9393
wait_seconds=0,
9494
currency="USD",
9595
)
@@ -107,20 +107,20 @@ def positions(self):
107107

108108
def accountValues(self):
109109
return [
110-
SimpleNamespace(account="U16608560", currency="USD", tag="NetLiquidation", value="1130"),
111-
SimpleNamespace(account="U16608560", currency="USD", tag="AvailableFunds", value="885.99"),
110+
SimpleNamespace(account="U00000000", currency="USD", tag="NetLiquidation", value="1130"),
111+
SimpleNamespace(account="U00000000", currency="USD", tag="AvailableFunds", value="885.99"),
112112
SimpleNamespace(
113-
account="U16608560",
113+
account="U00000000",
114114
currency="USD",
115115
tag="$LEDGER-CashBalance",
116116
value="477.10",
117117
),
118-
SimpleNamespace(account="U16608560", currency="USD", tag="TotalCashValue", value="500.00"),
118+
SimpleNamespace(account="U00000000", currency="USD", tag="TotalCashValue", value="500.00"),
119119
]
120120

121121
snapshot = fetch_portfolio_snapshot(
122122
LedgerCashIB(),
123-
account_ids=("U16608560",),
123+
account_ids=("U00000000",),
124124
wait_seconds=0,
125125
currency="USD",
126126
)
@@ -137,8 +137,8 @@ def positions(self):
137137

138138
def accountValues(self):
139139
return [
140-
SimpleNamespace(account="U16608560", currency="USD", tag="NetLiquidation", value="1130"),
141-
SimpleNamespace(account="U16608560", currency="USD", tag="TotalCashValue", value="500.00"),
140+
SimpleNamespace(account="U00000000", currency="USD", tag="NetLiquidation", value="1130"),
141+
SimpleNamespace(account="U00000000", currency="USD", tag="TotalCashValue", value="500.00"),
142142
]
143143

144144
with pytest.raises(
@@ -147,7 +147,7 @@ def accountValues(self):
147147
):
148148
fetch_portfolio_snapshot(
149149
AggregateCashIB(),
150-
account_ids=("U16608560",),
150+
account_ids=("U00000000",),
151151
wait_seconds=0,
152152
currency="USD",
153153
)
@@ -160,14 +160,14 @@ def positions(self):
160160

161161
def accountValues(self):
162162
return [
163-
SimpleNamespace(account="U16608560", currency="USD", tag="NetLiquidation", value="2160"),
164-
SimpleNamespace(account="U16608560", currency="USD", tag="AvailableFunds", value="1588.89"),
165-
SimpleNamespace(account="U16608560", currency="USD", tag="CashBalance", value="-284.0"),
163+
SimpleNamespace(account="U00000000", currency="USD", tag="NetLiquidation", value="2160"),
164+
SimpleNamespace(account="U00000000", currency="USD", tag="AvailableFunds", value="1588.89"),
165+
SimpleNamespace(account="U00000000", currency="USD", tag="CashBalance", value="-284.0"),
166166
]
167167

168168
snapshot = fetch_portfolio_snapshot(
169169
NegativeCashIB(),
170-
account_ids=("U16608560",),
170+
account_ids=("U00000000",),
171171
wait_seconds=0,
172172
currency="USD",
173173
)
@@ -184,7 +184,7 @@ def positions(self):
184184
def accountValues(self):
185185
return [
186186
SimpleNamespace(
187-
account="U16608560",
187+
account="U00000000",
188188
currency="USD",
189189
tag="NetLiquidation",
190190
value="1130",
@@ -197,7 +197,7 @@ def accountValues(self):
197197
):
198198
fetch_portfolio_snapshot(
199199
MissingCashIB(),
200-
account_ids=("U16608560",),
200+
account_ids=("U00000000",),
201201
wait_seconds=0,
202202
currency="USD",
203203
)
@@ -245,7 +245,7 @@ def positions(self):
245245
def accountValues(self):
246246
return [
247247
SimpleNamespace(
248-
account="U16608560",
248+
account="U00000000",
249249
currency="USD",
250250
tag="CashBalance",
251251
value="0",
@@ -254,7 +254,7 @@ def accountValues(self):
254254

255255
snapshot = fetch_portfolio_snapshot(
256256
ZeroCashIB(),
257-
account_ids=("U16608560",),
257+
account_ids=("U00000000",),
258258
wait_seconds=0,
259259
currency="USD",
260260
)

0 commit comments

Comments
 (0)