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

Function test_binary_concat

python/ccxt/test/base/test_binary_concat.py:17–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15import ccxt.async_support as ccxt # noqa: F402
16
17def test_binary_concat():
18 exchange = ccxt.Exchange({
19 'id': 'sampleexchange',
20 })
21 # Test 1: Concat two binaries
22 binary1 = exchange.string_to_binary('hello')
23 binary2 = exchange.string_to_binary(' world')
24 result1 = exchange.binary_concat(binary1, binary2)
25 assert exchange.binary_to_string(result1) == 'hello world'
26 # Test 2: Concat three binaries
27 binary3 = exchange.string_to_binary('foo')
28 binary4 = exchange.string_to_binary('bar')
29 binary5 = exchange.string_to_binary('baz')
30 result2 = exchange.binary_concat(binary3, binary4, binary5)
31 assert exchange.binary_to_string(result2) == 'foobarbaz'
32 # Test 3: Concat with hex bytes
33 result3 = exchange.binary_concat(exchange.base16_to_binary('68656c6c6f'), exchange.string_to_binary(' world'))
34 assert exchange.binary_to_string(result3) == 'hello world'

Callers 1

base_tests_initFunction · 0.90

Calls 5

string_to_binaryMethod · 0.95
binary_concatMethod · 0.95
binary_to_stringMethod · 0.95
base16_to_binaryMethod · 0.95
ExchangeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…