File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99# The maximum size of a file that can be published in a single request is 64MB
1010FILESIZE_LIMIT_MB = 64
1111
12+
1213class Config :
13- # For when a datasource is over 64MB, break it into 5MB(standard chunk size) chunks
14+ # For when a datasource is over 64MB, break it into 5MB(standard chunk size) chunks
1415 @property
1516 def CHUNK_SIZE_MB (self ):
1617 return int (os .getenv ("TSC_CHUNK_SIZE_MB" , 5 * 10 )) # 5MB felt too slow, upped it to 50
1718
18- # Default page size
19+ # Default page size
1920 @property
2021 def PAGE_SIZE (self ):
2122 return int (os .getenv ("TSC_PAGE_SIZE" , 100 ))
2223
24+
2325config = Config ()
Original file line number Diff line number Diff line change 1313GET_XML_PAGE2 = os .path .join (TEST_ASSET_DIR , "workbook_get_page_2.xml" )
1414GET_XML_PAGE3 = os .path .join (TEST_ASSET_DIR , "workbook_get_page_3.xml" )
1515
16+
1617@contextlib .contextmanager
1718def set_env (** environ ):
1819 old_environ = dict (os .environ )
@@ -23,6 +24,7 @@ def set_env(**environ):
2324 os .environ .clear ()
2425 os .environ .update (old_environ )
2526
27+
2628class PagerTests (unittest .TestCase ):
2729 def setUp (self ):
2830 self .server = TSC .Server ("http://test" , False )
@@ -100,13 +102,13 @@ def test_pager_with_options(self):
100102 wb3 = workbooks .pop ()
101103 self .assertEqual (wb3 .name , "Page3Workbook" )
102104
103- def test_pager_with_env_var (self ) -> None :
105+ def test_pager_with_env_var (self ):
104106 with set_env (TSC_PAGE_SIZE = "1000" ):
105107 assert config .PAGE_SIZE == 1000
106108 loop = TSC .Pager (self .server .workbooks )
107109 assert loop ._options .pagesize == 1000
108110
109- def test_queryset_with_env_var (self ) -> None :
111+ def test_queryset_with_env_var (self ):
110112 with set_env (TSC_PAGE_SIZE = "1000" ):
111113 assert config .PAGE_SIZE == 1000
112114 loop = self .server .workbooks .all ()
You can’t perform that action at this time.
0 commit comments