File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
2
from pyexcel_odsr .odsr import ODSBook
3
3
from pyexcel_ods .odsw import ODSWriter
4
+ from pyexcel ._compact import BytesIO
4
5
5
6
from base import ODSCellTypes
6
7
@@ -17,6 +18,33 @@ def setUp(self):
17
18
r .close ()
18
19
19
20
21
+ class TestODSReaderStream (ODSCellTypes ):
22
+ def setUp (self ):
23
+ r = ODSBook ()
24
+ with open (os .path .join ("tests" ,
25
+ "fixtures" ,
26
+ "ods_formats.ods" ), 'rb' ) as f :
27
+ r .open_stream (f )
28
+ self .data = r .read_all ()
29
+ for key in self .data .keys ():
30
+ self .data [key ] = list (self .data [key ])
31
+ r .close ()
32
+
33
+
34
+ class TestODSReaderBytesIO (ODSCellTypes ):
35
+ def setUp (self ):
36
+ r = ODSBook ()
37
+ with open (os .path .join ("tests" ,
38
+ "fixtures" ,
39
+ "ods_formats.ods" ), 'rb' ) as f :
40
+ io = BytesIO (f .read ())
41
+ r .open_stream (io )
42
+ self .data = r .read_all ()
43
+ for key in self .data .keys ():
44
+ self .data [key ] = list (self .data [key ])
45
+ r .close ()
46
+
47
+
20
48
class TestODSWriter (ODSCellTypes ):
21
49
def setUp (self ):
22
50
r = ODSBook ()
You can’t perform that action at this time.
0 commit comments