1- from polygon import RESTClient
1+ from mocks import BaseTest
22from polygon .rest .models import (
33 Agg ,
44 GroupedDailyAgg ,
55 DailyOpenCloseAgg ,
66 PreviousCloseAgg ,
77)
8- from mocks import BaseTest
98
109
1110class AggsTest (BaseTest ):
1211 def test_get_aggs (self ):
13- c = RESTClient ("" )
14- aggs = c .get_aggs ("AAPL" , 1 , "day" , "2005-04-01" , "2005-04-04" )
12+ aggs = self .c .get_aggs ("AAPL" , 1 , "day" , "2005-04-01" , "2005-04-04" )
1513 expected = [
1614 Agg (
1715 open = 1.5032 ,
@@ -37,8 +35,7 @@ def test_get_aggs(self):
3735 self .assertEqual (aggs , expected )
3836
3937 def test_get_grouped_daily_aggs (self ):
40- c = RESTClient ("" )
41- aggs = c .get_grouped_daily_aggs ("2005-04-04" , True )
38+ aggs = self .c .get_grouped_daily_aggs ("2005-04-04" , True )
4239 expected = [
4340 GroupedDailyAgg (
4441 ticker = "GIK" ,
@@ -55,8 +52,7 @@ def test_get_grouped_daily_aggs(self):
5552 self .assertEqual (aggs , expected )
5653
5754 def test_get_daily_open_close_agg (self ):
58- c = RESTClient ("" )
59- aggs = c .get_daily_open_close_agg ("AAPL" , "2005-04-01" , True )
55+ aggs = self .c .get_daily_open_close_agg ("AAPL" , "2005-04-01" , True )
6056 expected = [
6157 DailyOpenCloseAgg (
6258 after_hours = 123 ,
@@ -74,8 +70,7 @@ def test_get_daily_open_close_agg(self):
7470 self .assertEqual (aggs , expected )
7571
7672 def test_get_previous_close_agg (self ):
77- c = RESTClient ("" )
78- aggs = c .get_previous_close_agg ("AAPL" )
73+ aggs = self .c .get_previous_close_agg ("AAPL" )
7974 expected = [
8075 PreviousCloseAgg (
8176 ticker = "AAPL" ,
0 commit comments