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

Method test_response_statically

python/ccxt/test/tests_async.py:977–994  ·  view source on GitHub ↗
(self, exchange, method, skip_keys, data)

Source from the content-addressed store, hash-verified

975 return True
976
977 async def test_response_statically(self, exchange, method, skip_keys, data):
978 expected_result = exchange.safe_value(data, 'parsedResponse')
979 mocked_exchange = set_fetch_response(exchange, data['httpResponse'])
980 if self.info:
981 dump('[INFO] STATIC RESPONSE TEST:', method, ':', data['description'])
982 try:
983 if not is_sync():
984 unified_result = await call_exchange_method_dynamically(exchange, method, self.sanitize_data_input(data['input']))
985 self.assert_static_response_output(mocked_exchange, skip_keys, unified_result, expected_result)
986 else:
987 unified_result_sync = call_exchange_method_dynamically_sync(exchange, method, self.sanitize_data_input(data['input']))
988 self.assert_static_response_output(mocked_exchange, skip_keys, unified_result_sync, expected_result)
989 except Exception as e:
990 self.response_tests_failed = True
991 error_message = '[' + self.lang + '][STATIC_RESPONSE]' + '[' + exchange.id + ']' + '[' + method + ']' + '[' + data['description'] + ']' + exception_message(e)
992 dump('[TEST_FAILURE]' + error_message)
993 set_fetch_response(exchange, None) # reset state
994 return True
995
996 def init_offline_exchange(self, exchange_name):
997 markets = self.load_markets_from_file(exchange_name)

Callers 1

Calls 9

sanitize_data_inputMethod · 0.95
set_fetch_responseFunction · 0.90
dumpFunction · 0.90
is_syncFunction · 0.90
exception_messageFunction · 0.90
safe_valueMethod · 0.80

Tested by

no test coverage detected