MCPcopy Create free account
hub / github.com/ccxt/ccxt / assert_in_array

Function assert_in_array

python/ccxt/test/exchange/base/test_shared_methods.py:274–283  ·  view source on GitHub ↗
(exchange, skipped_properties, method, entry, key, expected_array, allow_null=True)

Source from the content-addressed store, hash-verified

272
273
274def assert_in_array(exchange, skipped_properties, method, entry, key, expected_array, allow_null=True):
275 if key in skipped_properties:
276 return
277 log_text = log_template(exchange, method, entry)
278 value = exchange.safe_value(entry, key)
279 assert value is not None or allow_null, 'value is null' + log_text
280 # todo: remove undefined check
281 if value is not None:
282 stingified_array_value = exchange.json(expected_array) # don't use expectedArray.join (','), as it bugs in other languages, if values are bool, undefined or etc..
283 assert exchange.in_array(value, expected_array), '"' + string_value(key) + '" key (value "' + string_value(value) + '") is not from the expected list : [' + stingified_array_value + ']' + log_text
284
285
286def assert_fee_structure(exchange, skipped_properties, method, entry, key, allow_null=True):

Callers

nothing calls this directly

Calls 5

log_templateFunction · 0.85
string_valueFunction · 0.85
safe_valueMethod · 0.80
in_arrayMethod · 0.80
jsonMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…