-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_deep_extend.py
68 lines (58 loc) · 1.35 KB
/
test_deep_extend.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# -*- coding: utf-8 -*-
# THIS IS A MOCKUP FILE IN PROGRESS
# import argparse
import os
import sys
from pprint import pprint
# import json
# import time
# ------------------------------------------------------------------------------
root = os.path.dirname(os.path.abspath(__file__))
sys.path.append(root)
# ------------------------------------------------------------------------------
import ccxt # noqa: E402
# ------------------------------------------------------------------------------
values = [
{
'a': 1,
'b': 2,
'd': {
'a': 1,
'b': [],
'c': {'test1': 123, 'test2': 321}},
'f': 5,
'g': 123,
'i': 321,
'j': [1, 2],
},
{
'b': 3,
'c': 5,
'd': {
'b': {'first': 'one', 'second': 'two'},
'c': {'test2': 222}},
'e': {'one': 1, 'two': 2},
'f': [{'foo': 'bar'}],
'g': None,
'h': r'abc',
'i': None,
'j': [3, 4]
}
]
pprint(ccxt.Exchange.deep_extend(*values))
# assert.deepEqual ({
# a: 1,
# b: 3,
# d: {
# a: 1,
# b: {first: 'one', second: 'two'},
# c: {test1: 123, test2: 222}
# },
# f: [{'foo': 'bar'}],
# g: undefined,
# c: 5,
# e: {one: 1, two: 2},
# h: /abc/g,
# i: null,
# j: [3, 4]
# }, extended)