@@ -456,7 +456,9 @@ def test_malformed(self):
456
456
2,3,4
457
457
"""
458
458
try :
459
- it = self .read_table (StringIO (data ), sep = ',' , header = 1 , comment = '#' , iterator = True , chunksize = 1 , skiprows = [2 ])
459
+ it = self .read_table (StringIO (data ), sep = ',' , header = 1 ,
460
+ comment = '#' , iterator = True , chunksize = 1 ,
461
+ skiprows = [2 ])
460
462
df = it .read (1 )
461
463
it .read (2 )
462
464
self .assert_ (False )
@@ -876,6 +878,17 @@ def test_read_chunksize_named(self):
876
878
tm .assert_frame_equal (chunks [1 ], df [2 :4 ])
877
879
tm .assert_frame_equal (chunks [2 ], df [4 :])
878
880
881
+ def test_get_chunk_passed_chunksize (self ):
882
+ data = """A,B,C
883
+ 1,2,3
884
+ 4,5,6
885
+ 7,8,9
886
+ 1,2,3"""
887
+ result = self .read_csv (StringIO (data ), chunksize = 2 )
888
+
889
+ piece = result .get_chunk ()
890
+ self .assertEqual (len (piece ), 2 )
891
+
879
892
def test_read_text_list (self ):
880
893
data = """A,B,C\n foo,1,2,3\n bar,4,5,6"""
881
894
as_list = [['A' , 'B' , 'C' ], ['foo' , '1' , '2' , '3' ], ['bar' ,
0 commit comments