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

Function test_urlencode

python/ccxt/test/base/test_urlencode.py:18–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16from ccxt.test.exchange.base import test_shared_methods # noqa E402
17
18def test_urlencode():
19 exchange = ccxt.Exchange({
20 'id': 'sampleexchange',
21 })
22 # todo: add nulls
23 # todo: add sort
24 dict1 = {
25 'a': 1,
26 'c': '+&',
27 }
28 # as key-order not preserved, expect mixed order
29 expected1 = 'a=1&c=%2B%26'
30 expected2 = 'c=%2B%26&a=1'
31 encoded = exchange.urlencode(dict1)
32 assert encoded == expected1 or encoded == expected2, 'testUrlencode: expected ' + expected1 + ' or ' + expected2 + ' but got ' + encoded

Callers 1

base_tests_initFunction · 0.90

Calls 2

urlencodeMethod · 0.95
ExchangeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…