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

Function test_clone

python/ccxt/test/base/test_clone.py:18–172  ·  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_clone():
19 exchange = ccxt.Exchange({
20 'id': 'sampleexchange',
21 })
22 obj1 = {
23 'a': 1,
24 'b': [1, 2, 3],
25 'c': [{
26 'test1': 1,
27 'test2': 1,
28}],
29 'd': None,
30 'e': 'not_undefined',
31 'sub': {
32 'a': 1,
33 'b': [1, 2],
34 'c': [{
35 'test1': 1,
36 'test2': 2,
37}],
38 'd': None,
39 'e': 'not_undefined',
40 'other1': 'x',
41 },
42 'other1': 'x',
43 }
44 obj2 = {
45 'a': 2,
46 'b': [3, 4],
47 'c': [{
48 'test1': 2,
49 'test3': 3,
50}],
51 'd': 'not_undefined',
52 'e': None,
53 'sub': {
54 'a': 2,
55 'b': [3, 4],
56 'c': [{
57 'test1': 2,
58 'test3': 3,
59}],
60 'd': 'not_undefined',
61 'e': None,
62 'other2': 'y',
63 },
64 'other2': 'y',
65 }
66 # deepExtend
67 deep_extended = exchange.deep_extend(obj1, obj2)
68 compare_to = {
69 'a': 2,
70 'b': [3, 4],
71 'c': [{
72 'test1': 2,
73 'test3': 3,
74}],
75 'd': 'not_undefined',

Callers 1

base_tests_initFunction · 0.90

Calls 3

deep_extendMethod · 0.95
cloneMethod · 0.95
ExchangeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…