ccxt 4.4.52__py2.py3-none-any.whl → 4.4.57__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccxt/__init__.py +1 -3
- ccxt/abstract/binance.py +0 -1
- ccxt/abstract/binancecoinm.py +0 -1
- ccxt/abstract/binanceus.py +0 -1
- ccxt/abstract/binanceusdm.py +0 -1
- ccxt/ace.py +3 -0
- ccxt/alpaca.py +5 -0
- ccxt/ascendex.py +2 -1
- ccxt/async_support/__init__.py +1 -3
- ccxt/async_support/ace.py +3 -0
- ccxt/async_support/alpaca.py +5 -0
- ccxt/async_support/ascendex.py +2 -1
- ccxt/async_support/base/exchange.py +24 -7
- ccxt/async_support/bigone.py +5 -0
- ccxt/async_support/binance.py +54 -54
- ccxt/async_support/bingx.py +25 -29
- ccxt/async_support/bit2c.py +3 -0
- ccxt/async_support/bitbank.py +3 -0
- ccxt/async_support/bitbns.py +3 -0
- ccxt/async_support/bitfinex.py +6 -1
- ccxt/async_support/bitflyer.py +6 -1
- ccxt/async_support/bitget.py +9 -5
- ccxt/async_support/bithumb.py +3 -1
- ccxt/async_support/bitmart.py +22 -12
- ccxt/async_support/bitmex.py +99 -93
- ccxt/async_support/bitopro.py +7 -2
- ccxt/async_support/bitrue.py +4 -0
- ccxt/async_support/bitso.py +5 -2
- ccxt/async_support/bitstamp.py +3 -0
- ccxt/async_support/bitteam.py +5 -0
- ccxt/async_support/bitvavo.py +4 -0
- ccxt/async_support/blockchaincom.py +4 -0
- ccxt/async_support/blofin.py +3 -0
- ccxt/async_support/btcalpha.py +5 -0
- ccxt/async_support/btcbox.py +3 -2
- ccxt/async_support/btcmarkets.py +5 -0
- ccxt/async_support/btcturk.py +3 -0
- ccxt/async_support/bybit.py +13 -5
- ccxt/async_support/cex.py +2 -0
- ccxt/async_support/coinbase.py +20 -13
- ccxt/async_support/coinbaseexchange.py +5 -0
- ccxt/async_support/coinbaseinternational.py +23 -4
- ccxt/async_support/coincatch.py +3 -0
- ccxt/async_support/coincheck.py +2 -0
- ccxt/async_support/coinex.py +6 -2
- ccxt/async_support/coinlist.py +5 -0
- ccxt/async_support/coinmate.py +4 -0
- ccxt/async_support/coinmetro.py +9 -5
- ccxt/async_support/coinone.py +3 -0
- ccxt/async_support/coinsph.py +4 -0
- ccxt/async_support/coinspot.py +1 -0
- ccxt/async_support/cryptocom.py +5 -0
- ccxt/async_support/currencycom.py +3 -0
- ccxt/async_support/defx.py +5 -0
- ccxt/async_support/delta.py +4 -1
- ccxt/async_support/deribit.py +15 -28
- ccxt/async_support/digifinex.py +10 -5
- ccxt/async_support/ellipx.py +9 -5
- ccxt/async_support/exmo.py +7 -4
- ccxt/async_support/gate.py +5 -1
- ccxt/async_support/gemini.py +3 -0
- ccxt/async_support/hashkey.py +5 -4
- ccxt/async_support/hitbtc.py +6 -2
- ccxt/async_support/hollaex.py +7 -2
- ccxt/async_support/htx.py +8 -1
- ccxt/async_support/huobijp.py +5 -0
- ccxt/async_support/hyperliquid.py +9 -4
- ccxt/async_support/idex.py +5 -1
- ccxt/async_support/independentreserve.py +4 -0
- ccxt/async_support/indodax.py +3 -0
- ccxt/async_support/kraken.py +7 -5
- ccxt/async_support/krakenfutures.py +5 -2
- ccxt/async_support/kucoin.py +13 -6
- ccxt/async_support/kucoinfutures.py +5 -1
- ccxt/async_support/kuna.py +3 -0
- ccxt/async_support/latoken.py +4 -0
- ccxt/async_support/lbank.py +6 -1
- ccxt/async_support/luno.py +6 -1
- ccxt/async_support/mercado.py +4 -0
- ccxt/async_support/mexc.py +10 -9
- ccxt/async_support/ndax.py +6 -1
- ccxt/async_support/novadax.py +5 -0
- ccxt/async_support/oceanex.py +6 -2
- ccxt/async_support/okcoin.py +4 -0
- ccxt/async_support/okx.py +17 -5
- ccxt/async_support/onetrading.py +4 -0
- ccxt/async_support/oxfun.py +3 -0
- ccxt/async_support/p2b.py +3 -0
- ccxt/async_support/paradex.py +8 -2
- ccxt/async_support/phemex.py +10 -4
- ccxt/async_support/poloniex.py +6 -3
- ccxt/async_support/poloniexfutures.py +5 -1
- ccxt/async_support/probit.py +4 -0
- ccxt/async_support/timex.py +4 -0
- ccxt/async_support/tokocrypto.py +5 -0
- ccxt/async_support/tradeogre.py +2 -0
- ccxt/async_support/upbit.py +5 -2
- ccxt/async_support/vertex.py +6 -2
- ccxt/async_support/wavesexchange.py +20 -3
- ccxt/async_support/wazirx.py +2 -0
- ccxt/async_support/whitebit.py +5 -4
- ccxt/async_support/woo.py +15 -5
- ccxt/async_support/woofipro.py +23 -9
- ccxt/async_support/xt.py +5 -0
- ccxt/async_support/yobit.py +5 -2
- ccxt/async_support/zaif.py +2 -0
- ccxt/async_support/zonda.py +2 -0
- ccxt/base/exchange.py +96 -54
- ccxt/base/types.py +1 -1
- ccxt/bigone.py +5 -0
- ccxt/binance.py +54 -54
- ccxt/bingx.py +25 -29
- ccxt/bit2c.py +3 -0
- ccxt/bitbank.py +3 -0
- ccxt/bitbns.py +3 -0
- ccxt/bitfinex.py +6 -1
- ccxt/bitflyer.py +6 -1
- ccxt/bitget.py +9 -5
- ccxt/bithumb.py +3 -1
- ccxt/bitmart.py +22 -12
- ccxt/bitmex.py +99 -93
- ccxt/bitopro.py +7 -2
- ccxt/bitrue.py +4 -0
- ccxt/bitso.py +5 -2
- ccxt/bitstamp.py +3 -0
- ccxt/bitteam.py +5 -0
- ccxt/bitvavo.py +4 -0
- ccxt/blockchaincom.py +4 -0
- ccxt/blofin.py +3 -0
- ccxt/btcalpha.py +5 -0
- ccxt/btcbox.py +3 -2
- ccxt/btcmarkets.py +5 -0
- ccxt/btcturk.py +3 -0
- ccxt/bybit.py +13 -5
- ccxt/cex.py +2 -0
- ccxt/coinbase.py +20 -13
- ccxt/coinbaseexchange.py +5 -0
- ccxt/coinbaseinternational.py +23 -4
- ccxt/coincatch.py +3 -0
- ccxt/coincheck.py +2 -0
- ccxt/coinex.py +6 -2
- ccxt/coinlist.py +5 -0
- ccxt/coinmate.py +4 -0
- ccxt/coinmetro.py +9 -5
- ccxt/coinone.py +3 -0
- ccxt/coinsph.py +4 -0
- ccxt/coinspot.py +1 -0
- ccxt/cryptocom.py +5 -0
- ccxt/currencycom.py +3 -0
- ccxt/defx.py +5 -0
- ccxt/delta.py +4 -1
- ccxt/deribit.py +15 -28
- ccxt/digifinex.py +10 -5
- ccxt/ellipx.py +9 -5
- ccxt/exmo.py +7 -4
- ccxt/gate.py +5 -1
- ccxt/gemini.py +3 -0
- ccxt/hashkey.py +5 -4
- ccxt/hitbtc.py +6 -2
- ccxt/hollaex.py +7 -2
- ccxt/htx.py +8 -1
- ccxt/huobijp.py +5 -0
- ccxt/hyperliquid.py +9 -4
- ccxt/idex.py +5 -1
- ccxt/independentreserve.py +4 -0
- ccxt/indodax.py +3 -0
- ccxt/kraken.py +7 -5
- ccxt/krakenfutures.py +5 -2
- ccxt/kucoin.py +13 -6
- ccxt/kucoinfutures.py +5 -1
- ccxt/kuna.py +3 -0
- ccxt/latoken.py +4 -0
- ccxt/lbank.py +6 -1
- ccxt/luno.py +6 -1
- ccxt/mercado.py +4 -0
- ccxt/mexc.py +10 -9
- ccxt/ndax.py +6 -1
- ccxt/novadax.py +5 -0
- ccxt/oceanex.py +6 -2
- ccxt/okcoin.py +4 -0
- ccxt/okx.py +17 -5
- ccxt/onetrading.py +4 -0
- ccxt/oxfun.py +3 -0
- ccxt/p2b.py +3 -0
- ccxt/paradex.py +8 -2
- ccxt/phemex.py +10 -4
- ccxt/poloniex.py +6 -3
- ccxt/poloniexfutures.py +5 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +2 -2
- ccxt/pro/bitcoincom.py +1 -4
- ccxt/pro/bitget.py +3 -3
- ccxt/pro/bitopro.py +1 -1
- ccxt/pro/bybit.py +7 -2
- ccxt/pro/cex.py +1 -1
- ccxt/pro/coincatch.py +3 -3
- ccxt/pro/mexc.py +3 -3
- ccxt/pro/okx.py +1 -1
- ccxt/probit.py +4 -0
- ccxt/test/tests_async.py +57 -30
- ccxt/test/tests_sync.py +57 -30
- ccxt/timex.py +4 -0
- ccxt/tokocrypto.py +5 -0
- ccxt/tradeogre.py +2 -0
- ccxt/upbit.py +5 -2
- ccxt/vertex.py +6 -2
- ccxt/wavesexchange.py +20 -3
- ccxt/wazirx.py +2 -0
- ccxt/whitebit.py +5 -4
- ccxt/woo.py +15 -5
- ccxt/woofipro.py +23 -9
- ccxt/xt.py +5 -0
- ccxt/yobit.py +5 -2
- ccxt/zaif.py +2 -0
- ccxt/zonda.py +2 -0
- {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/METADATA +225 -143
- {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/RECORD +220 -223
- ccxt/abstract/lykke.py +0 -29
- ccxt/async_support/lykke.py +0 -1370
- ccxt/lykke.py +0 -1370
- {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/WHEEL +0 -0
- {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/top_level.txt +0 -0
ccxt/test/tests_async.py
CHANGED
@@ -49,16 +49,16 @@ class testMainClass:
|
|
49
49
|
if self.request_tests and self.response_tests:
|
50
50
|
await self.run_static_request_tests(exchange_id, symbol_argv)
|
51
51
|
await self.run_static_response_tests(exchange_id, symbol_argv)
|
52
|
-
return
|
52
|
+
return True
|
53
53
|
if self.response_tests:
|
54
54
|
await self.run_static_response_tests(exchange_id, symbol_argv)
|
55
|
-
return
|
55
|
+
return True
|
56
56
|
if self.request_tests:
|
57
57
|
await self.run_static_request_tests(exchange_id, symbol_argv) # symbol here is the testname
|
58
|
-
return
|
58
|
+
return True
|
59
59
|
if self.id_tests:
|
60
60
|
await self.run_broker_id_tests()
|
61
|
-
return
|
61
|
+
return True
|
62
62
|
new_line = '\n'
|
63
63
|
dump(new_line + '' + new_line + '' + '[INFO] TESTING ', self.ext, {
|
64
64
|
'exchange': exchange_id,
|
@@ -103,6 +103,7 @@ class testMainClass:
|
|
103
103
|
self.test_files = get_test_files_sync(properties, self.ws_tests)
|
104
104
|
else:
|
105
105
|
self.test_files = await get_test_files(properties, self.ws_tests)
|
106
|
+
return True
|
106
107
|
|
107
108
|
def load_credentials_from_env(self, exchange):
|
108
109
|
exchange_id = exchange.id
|
@@ -125,8 +126,12 @@ class testMainClass:
|
|
125
126
|
keys_local = get_root_dir() + 'keys.local.json'
|
126
127
|
keys_global_exists = io_file_exists(keys_global)
|
127
128
|
keys_local_exists = io_file_exists(keys_local)
|
128
|
-
global_settings =
|
129
|
-
|
129
|
+
global_settings = {}
|
130
|
+
if keys_global_exists:
|
131
|
+
global_settings = io_file_read(keys_global)
|
132
|
+
local_settings = {}
|
133
|
+
if keys_local_exists:
|
134
|
+
local_settings = io_file_read(keys_local)
|
130
135
|
all_settings = exchange.deep_extend(global_settings, local_settings)
|
131
136
|
exchange_settings = exchange.safe_value(all_settings, exchange_id, {})
|
132
137
|
if exchange_settings:
|
@@ -177,7 +182,7 @@ class testMainClass:
|
|
177
182
|
exchange.options['checksum'] = False
|
178
183
|
# todo: temporary skip for php
|
179
184
|
if 'OrderBook' in method_name and self.ext == 'php':
|
180
|
-
return
|
185
|
+
return True
|
181
186
|
skipped_properties_for_method = self.get_skips(exchange, method_name)
|
182
187
|
is_load_markets = (method_name == 'loadMarkets')
|
183
188
|
is_fetch_currencies = (method_name == 'fetchCurrencies')
|
@@ -185,7 +190,7 @@ class testMainClass:
|
|
185
190
|
is_feature_test = (method_name == 'features')
|
186
191
|
# if this is a private test, and the implementation was already tested in public, then no need to re-test it in private test (exception is fetchCurrencies, because our approach in base exchange)
|
187
192
|
if not is_public and (method_name in self.checked_public_tests) and not is_fetch_currencies:
|
188
|
-
return
|
193
|
+
return True
|
189
194
|
skip_message = None
|
190
195
|
supported_by_exchange = (method_name in exchange.has) and exchange.has[method_name]
|
191
196
|
if not is_load_markets and (len(self.only_specific_tests) > 0 and not exchange.in_array(method_name, self.only_specific_tests)):
|
@@ -203,7 +208,7 @@ class testMainClass:
|
|
203
208
|
if skip_message:
|
204
209
|
if self.info:
|
205
210
|
dump(self.add_padding(skip_message, 25), name, method_name)
|
206
|
-
return
|
211
|
+
return True
|
207
212
|
if self.info:
|
208
213
|
args_stringified = '(' + exchange.json(args) + ')' # args.join() breaks when we provide a list of symbols or multidimensional array; "args.toString()" breaks bcz of "array to string conversion"
|
209
214
|
dump(self.add_padding('[INFO] TESTING', 25), name, method_name, args_stringified)
|
@@ -216,7 +221,7 @@ class testMainClass:
|
|
216
221
|
# add to the list of successed tests
|
217
222
|
if is_public:
|
218
223
|
self.checked_public_tests[method_name] = True
|
219
|
-
return
|
224
|
+
return True
|
220
225
|
|
221
226
|
def get_skips(self, exchange, method_name):
|
222
227
|
final_skips = {}
|
@@ -285,10 +290,10 @@ class testMainClass:
|
|
285
290
|
is_on_maintenance = (isinstance(e, OnMaintenance))
|
286
291
|
is_exchange_not_available = (isinstance(e, ExchangeNotAvailable))
|
287
292
|
should_fail = None
|
288
|
-
|
293
|
+
ret_success = None
|
289
294
|
if is_load_markets:
|
290
295
|
# if "loadMarkets" does not succeed, we must return "false" to caller method, to stop tests continual
|
291
|
-
|
296
|
+
ret_success = False
|
292
297
|
# we might not break exchange tests, if exchange is on maintenance at this moment
|
293
298
|
if is_on_maintenance:
|
294
299
|
should_fail = False
|
@@ -299,20 +304,19 @@ class testMainClass:
|
|
299
304
|
if is_exchange_not_available and not is_on_maintenance:
|
300
305
|
# break exchange tests if "ExchangeNotAvailable" exception is thrown, but it's not maintenance
|
301
306
|
should_fail = True
|
302
|
-
|
307
|
+
ret_success = False
|
303
308
|
else:
|
304
309
|
# in all other cases of OperationFailed, show Warning, but don't mark test as failed
|
305
310
|
should_fail = False
|
306
|
-
|
311
|
+
ret_success = True
|
307
312
|
# output the message
|
308
313
|
fail_type = '[TEST_FAILURE]' if should_fail else '[TEST_WARNING]'
|
309
314
|
dump(fail_type, 'Method could not be tested due to a repeated Network/Availability issues', ' | ', exchange.id, method_name, args_stringified, exception_message(e))
|
310
|
-
return
|
315
|
+
return ret_success
|
311
316
|
else:
|
312
317
|
# wait and retry again
|
313
318
|
# (increase wait time on every retry)
|
314
319
|
await exchange.sleep((i + 1) * 1000)
|
315
|
-
continue
|
316
320
|
else:
|
317
321
|
# if it's loadMarkets, then fail test, because it's mandatory for tests
|
318
322
|
if is_load_markets:
|
@@ -376,6 +380,7 @@ class testMainClass:
|
|
376
380
|
tests['fetchPremiumIndexOHLCV'] = [symbol]
|
377
381
|
self.public_tests = tests
|
378
382
|
await self.run_tests(exchange, tests, True)
|
383
|
+
return True
|
379
384
|
|
380
385
|
async def run_tests(self, exchange, tests, is_public_test):
|
381
386
|
test_names = list(tests.keys())
|
@@ -400,6 +405,7 @@ class testMainClass:
|
|
400
405
|
dump('[TEST_FAILURE]', exchange.id, test_prefix_string, 'Failed methods : ' + errors_string)
|
401
406
|
if self.info:
|
402
407
|
dump(self.add_padding('[INFO] END ' + test_prefix_string + ' ' + exchange.id, 25))
|
408
|
+
return True
|
403
409
|
|
404
410
|
async def load_exchange(self, exchange):
|
405
411
|
result = await self.test_safe('loadMarkets', exchange, [], True)
|
@@ -520,11 +526,12 @@ class testMainClass:
|
|
520
526
|
if exchange.has['swap'] and swap_symbol is not None:
|
521
527
|
exchange.options['defaultType'] = 'swap'
|
522
528
|
await self.run_private_tests(exchange, swap_symbol)
|
529
|
+
return True
|
523
530
|
|
524
531
|
async def run_private_tests(self, exchange, symbol):
|
525
532
|
if not exchange.check_required_credentials(False):
|
526
533
|
dump('[INFO] Skipping private tests', 'Keys not found')
|
527
|
-
return
|
534
|
+
return True
|
528
535
|
code = self.get_exchange_code(exchange)
|
529
536
|
# if (exchange.deepExtendedTest) {
|
530
537
|
# await test ('InvalidNonce', exchange, symbol);
|
@@ -594,14 +601,14 @@ class testMainClass:
|
|
594
601
|
proxy_test_name = self.proxy_test_file_name
|
595
602
|
# todo: temporary skip for sync py
|
596
603
|
if self.ext == 'py' and is_sync():
|
597
|
-
return
|
604
|
+
return True
|
598
605
|
# try proxy several times
|
599
606
|
max_retries = 3
|
600
607
|
exception = None
|
601
608
|
for j in range(0, max_retries):
|
602
609
|
try:
|
603
610
|
await self.test_method(proxy_test_name, exchange, [], True)
|
604
|
-
return # if successfull, then end the test
|
611
|
+
return True # if successfull, then end the test
|
605
612
|
except Exception as e:
|
606
613
|
exception = e
|
607
614
|
await exchange.sleep(j * 1000)
|
@@ -610,12 +617,13 @@ class testMainClass:
|
|
610
617
|
error_message = '[TEST_FAILURE] Failed ' + proxy_test_name + ' : ' + exception_message(exception)
|
611
618
|
# temporary comment the below, because c# transpilation failure
|
612
619
|
# throw new Exchange Error (errorMessage.toString ());
|
613
|
-
dump('[TEST_WARNING]' +
|
620
|
+
dump('[TEST_WARNING]' + error_message)
|
621
|
+
return True
|
614
622
|
|
615
623
|
async def start_test(self, exchange, symbol):
|
616
624
|
# we do not need to test aliases
|
617
625
|
if exchange.alias:
|
618
|
-
return
|
626
|
+
return True
|
619
627
|
if self.sandbox or get_exchange_prop(exchange, 'sandbox'):
|
620
628
|
exchange.set_sandbox_mode(True)
|
621
629
|
try:
|
@@ -623,7 +631,7 @@ class testMainClass:
|
|
623
631
|
if not result:
|
624
632
|
if not is_sync():
|
625
633
|
await close(exchange)
|
626
|
-
return
|
634
|
+
return True
|
627
635
|
# if (exchange.id === 'binance') {
|
628
636
|
# # we test proxies functionality just for one random exchange on each build, because proxy functionality is not exchange-specific, instead it's all done from base methods, so just one working sample would mean it works for all ccxt exchanges
|
629
637
|
# # await this.testProxies (exchange);
|
@@ -798,13 +806,15 @@ class testMainClass:
|
|
798
806
|
return True # c# requ
|
799
807
|
|
800
808
|
def assert_new_and_stored_output(self, exchange, skip_keys, new_output, stored_output, strict_type_check=True, asserting_key=None):
|
809
|
+
res = True
|
801
810
|
try:
|
802
|
-
|
811
|
+
res = self.assert_new_and_stored_output_inner(exchange, skip_keys, new_output, stored_output, strict_type_check, asserting_key)
|
803
812
|
except Exception as e:
|
804
813
|
if self.info:
|
805
814
|
error_message = self.var_to_string(new_output) + '(calculated)' + ' != ' + self.var_to_string(stored_output) + '(stored)'
|
806
815
|
dump('[TEST_FAILURE_DETAIL]' + error_message)
|
807
816
|
raise e
|
817
|
+
return res
|
808
818
|
|
809
819
|
def var_to_string(self, obj=None):
|
810
820
|
new_string = None
|
@@ -833,11 +843,11 @@ class testMainClass:
|
|
833
843
|
if (stored_url_query is None) and (new_url_query is None):
|
834
844
|
# might be a get request without any query parameters
|
835
845
|
# example: https://api.gateio.ws/api/v4/delivery/usdt/positions
|
836
|
-
return
|
846
|
+
return True
|
837
847
|
stored_url_params = self.urlencoded_to_dict(stored_url_query)
|
838
848
|
new_url_params = self.urlencoded_to_dict(new_url_query)
|
839
849
|
self.assert_new_and_stored_output(exchange, skip_keys, new_url_params, stored_url_params)
|
840
|
-
return
|
850
|
+
return True
|
841
851
|
if type == 'json' and (stored_output is not None) and (new_output is not None):
|
842
852
|
if isinstance(stored_output, str):
|
843
853
|
stored_output = json_parse(stored_output)
|
@@ -854,6 +864,7 @@ class testMainClass:
|
|
854
864
|
stored_output = self.urlencoded_to_dict(stored_output)
|
855
865
|
new_output = self.urlencoded_to_dict(new_output)
|
856
866
|
self.assert_new_and_stored_output(exchange, skip_keys, new_output, stored_output)
|
867
|
+
return True
|
857
868
|
|
858
869
|
def assert_static_response_output(self, exchange, skip_keys, computed_result, stored_result):
|
859
870
|
self.assert_new_and_stored_output(exchange, skip_keys, computed_result, stored_result, False)
|
@@ -889,8 +900,9 @@ class testMainClass:
|
|
889
900
|
self.assert_static_request_output(exchange, type, skip_keys, data['url'], request_url, call_output, output)
|
890
901
|
except Exception as e:
|
891
902
|
self.request_tests_failed = True
|
892
|
-
error_message = '[' + self.lang + '][STATIC_REQUEST]' + '[' + exchange.id + ']' + '[' + method + ']' + '[' + data['description'] + ']' +
|
903
|
+
error_message = '[' + self.lang + '][STATIC_REQUEST]' + '[' + exchange.id + ']' + '[' + method + ']' + '[' + data['description'] + ']' + exception_message(e)
|
893
904
|
dump('[TEST_FAILURE]' + error_message)
|
905
|
+
return True
|
894
906
|
|
895
907
|
async def test_response_statically(self, exchange, method, skip_keys, data):
|
896
908
|
expected_result = exchange.safe_value(data, 'parsedResponse')
|
@@ -904,9 +916,10 @@ class testMainClass:
|
|
904
916
|
self.assert_static_response_output(mocked_exchange, skip_keys, unified_result_sync, expected_result)
|
905
917
|
except Exception as e:
|
906
918
|
self.response_tests_failed = True
|
907
|
-
error_message = '[' + self.lang + '][STATIC_RESPONSE]' + '[' + exchange.id + ']' + '[' + method + ']' + '[' + data['description'] + ']' +
|
919
|
+
error_message = '[' + self.lang + '][STATIC_RESPONSE]' + '[' + exchange.id + ']' + '[' + method + ']' + '[' + data['description'] + ']' + exception_message(e)
|
908
920
|
dump('[TEST_FAILURE]' + error_message)
|
909
921
|
set_fetch_response(exchange, None) # reset state
|
922
|
+
return True
|
910
923
|
|
911
924
|
def init_offline_exchange(self, exchange_name):
|
912
925
|
markets = self.load_markets_from_file(exchange_name)
|
@@ -942,7 +955,8 @@ class testMainClass:
|
|
942
955
|
'leverageBrackets': {},
|
943
956
|
},
|
944
957
|
})
|
945
|
-
exchange.currencies = currencies
|
958
|
+
exchange.currencies = currencies
|
959
|
+
# not working in python if assigned in the config dict
|
946
960
|
return exchange
|
947
961
|
|
948
962
|
async def test_exchange_request_statically(self, exchange_name, exchange_data, test_name=None):
|
@@ -990,6 +1004,9 @@ class testMainClass:
|
|
990
1004
|
is_disabled_c_sharp = exchange.safe_bool(result, 'disabledCS', False)
|
991
1005
|
if is_disabled_c_sharp and (self.lang == 'C#'):
|
992
1006
|
continue
|
1007
|
+
is_disabled_go = exchange.safe_bool(result, 'disabledGO', False)
|
1008
|
+
if is_disabled_go and (self.lang == 'GO'):
|
1009
|
+
continue
|
993
1010
|
type = exchange.safe_string(exchange_data, 'outputType')
|
994
1011
|
skip_keys = exchange.safe_value(exchange_data, 'skipKeys', [])
|
995
1012
|
await self.test_request_statically(exchange, method, result, type, skip_keys)
|
@@ -1041,6 +1058,9 @@ class testMainClass:
|
|
1041
1058
|
continue
|
1042
1059
|
if (test_name is not None) and (test_name != description):
|
1043
1060
|
continue
|
1061
|
+
is_disabled_go = exchange.safe_bool(result, 'disabledGO', False)
|
1062
|
+
if is_disabled_go and (self.lang == 'GO'):
|
1063
|
+
continue
|
1044
1064
|
skip_keys = exchange.safe_value(exchange_data, 'skipKeys', [])
|
1045
1065
|
await self.test_response_statically(exchange, method, skip_keys, result)
|
1046
1066
|
# reset options
|
@@ -1065,12 +1085,13 @@ class testMainClass:
|
|
1065
1085
|
|
1066
1086
|
async def run_static_request_tests(self, target_exchange=None, test_name=None):
|
1067
1087
|
await self.run_static_tests('request', target_exchange, test_name)
|
1088
|
+
return True
|
1068
1089
|
|
1069
1090
|
async def run_static_tests(self, type, target_exchange=None, test_name=None):
|
1070
1091
|
folder = get_root_dir() + './ts/src/test/static/' + type + '/'
|
1071
1092
|
static_data = self.load_static_data(folder, target_exchange)
|
1072
1093
|
if static_data is None:
|
1073
|
-
return
|
1094
|
+
return True
|
1074
1095
|
exchanges = list(static_data.keys())
|
1075
1096
|
exchange = init_exchange('Exchange', {}) # tmp to do the calculations until we have the ast-transpiler transpiling this code
|
1076
1097
|
promises = []
|
@@ -1095,7 +1116,7 @@ class testMainClass:
|
|
1095
1116
|
self.request_tests_failed = True
|
1096
1117
|
else:
|
1097
1118
|
self.response_tests_failed = True
|
1098
|
-
error_message = '[' + self.lang + '][STATIC_REQUEST]' +
|
1119
|
+
error_message = '[' + self.lang + '][STATIC_REQUEST]' + exception_message(e)
|
1099
1120
|
dump('[TEST_FAILURE]' + error_message)
|
1100
1121
|
if self.request_tests_failed or self.response_tests_failed:
|
1101
1122
|
exit_script(1)
|
@@ -1109,6 +1130,7 @@ class testMainClass:
|
|
1109
1130
|
# --- Init of mockResponses tests functions------------------------------------
|
1110
1131
|
# -----------------------------------------------------------------------------
|
1111
1132
|
await self.run_static_tests('response', exchange_name, test)
|
1133
|
+
return True
|
1112
1134
|
|
1113
1135
|
async def run_broker_id_tests(self):
|
1114
1136
|
# -----------------------------------------------------------------------------
|
@@ -1119,6 +1141,7 @@ class testMainClass:
|
|
1119
1141
|
success_message = '[' + self.lang + '][TEST_SUCCESS] brokerId tests passed.'
|
1120
1142
|
dump('[INFO]' + success_message)
|
1121
1143
|
exit_script(0)
|
1144
|
+
return True
|
1122
1145
|
|
1123
1146
|
async def test_binance(self):
|
1124
1147
|
exchange = self.init_offline_exchange('binance')
|
@@ -1372,6 +1395,7 @@ class testMainClass:
|
|
1372
1395
|
assert req_headers['X-SOURCE-KEY'] == id, 'bingx - id: ' + id + ' not in headers.'
|
1373
1396
|
if not is_sync():
|
1374
1397
|
await close(exchange)
|
1398
|
+
return True
|
1375
1399
|
|
1376
1400
|
async def test_phemex(self):
|
1377
1401
|
exchange = self.init_offline_exchange('phemex')
|
@@ -1386,6 +1410,7 @@ class testMainClass:
|
|
1386
1410
|
assert client_order_id.startswith(id_string), 'phemex - clOrdID: ' + client_order_id + ' does not start with id: ' + id_string
|
1387
1411
|
if not is_sync():
|
1388
1412
|
await close(exchange)
|
1413
|
+
return True
|
1389
1414
|
|
1390
1415
|
async def test_blofin(self):
|
1391
1416
|
exchange = self.init_offline_exchange('blofin')
|
@@ -1400,6 +1425,7 @@ class testMainClass:
|
|
1400
1425
|
assert broker_id.startswith(id_string), 'blofin - brokerId: ' + broker_id + ' does not start with id: ' + id_string
|
1401
1426
|
if not is_sync():
|
1402
1427
|
await close(exchange)
|
1428
|
+
return True
|
1403
1429
|
|
1404
1430
|
async def test_hyperliquid(self):
|
1405
1431
|
exchange = self.init_offline_exchange('hyperliquid')
|
@@ -1413,6 +1439,7 @@ class testMainClass:
|
|
1413
1439
|
assert broker_id == id, 'hyperliquid - brokerId: ' + broker_id + ' does not start with id: ' + id
|
1414
1440
|
if not is_sync():
|
1415
1441
|
await close(exchange)
|
1442
|
+
return True
|
1416
1443
|
|
1417
1444
|
async def test_coinbaseinternational(self):
|
1418
1445
|
exchange = self.init_offline_exchange('coinbaseinternational')
|