-
Notifications
You must be signed in to change notification settings - Fork 250
/
Copy pathtest_modelclass.py
51 lines (48 loc) · 1.17 KB
/
test_modelclass.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
from polygon.rest.models import Agg
from base import BaseTest
class ModelclassTest(BaseTest):
def test_extra_field(self):
a = Agg(
open=1.5032,
high=1.5064,
low=1.4489,
close=1.4604,
volume=642646396.0,
vwap=1.469,
timestamp=1112331600000,
transactions=82132,
)
b = Agg(
open=1.5032,
high=1.5064,
low=1.4489,
close=1.4604,
volume=642646396.0,
vwap=1.469,
timestamp=1112331600000,
transactions=82132,
extra_field=22,
)
self.assertEqual(a, b)
def test_init_order(self):
a = Agg(
open=1.5032,
high=1.5064,
low=1.4489,
close=1.4604,
volume=642646396.0,
vwap=1.469,
timestamp=1112331600000,
transactions=82132,
)
b = Agg(
1.5032,
1.5064,
1.4489,
1.4604,
642646396.0,
1.469,
1112331600000,
82132,
)
self.assertEqual(a, b)