MCPcopy Index your code
hub / github.com/ccxt/ccxt / test_response_statically

Method test_response_statically

python/ccxt/test/tests_sync.py:974–991  ·  view source on GitHub ↗
(self, exchange, method, skip_keys, data)

Source from the content-addressed store, hash-verified

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