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

Function helper_test_init_sandbox

python/ccxt/test/base/test_after_constructor.py:51–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49
50
51def helper_test_init_sandbox():
52 # todo: sandbox for real exchanges
53 opts = {
54 'id': 'sampleexchange',
55 'options': {
56 'sandbox': False,
57 },
58 'urls': {
59 'api': {
60 'public': 'https://example.com',
61 },
62 'test': {
63 'public': 'https://testnet.org',
64 },
65 },
66 }
67 #
68 # CASE A: when sandbox is not enabled
69 #
70 exchange3 = ccxt.Exchange(opts)
71 helper_test_sandbox_state(exchange3, False)
72 exchange3.set_sandbox_mode(True)
73 helper_test_sandbox_state(exchange3, True)
74 #
75 # CASE B: when sandbox is enabled
76 #
77 opts['options']['sandbox'] = True
78 exchange4 = ccxt.Exchange(opts)
79 helper_test_sandbox_state(exchange4, True)
80 exchange4.set_sandbox_mode(False)
81 helper_test_sandbox_state(exchange4, False)
82
83
84def helper_test_init_market():

Callers 1

test_after_constructorFunction · 0.85

Calls 3

set_sandbox_modeMethod · 0.95
ExchangeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…