Skip to content

Commit 0264098

Browse files
committed
test more stream types for odsr
1 parent f66ca48 commit 0264098

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/test_ods_reader.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
from pyexcel_odsr.odsr import ODSBook
33
from pyexcel_ods.odsw import ODSWriter
4+
from pyexcel._compact import BytesIO
45

56
from base import ODSCellTypes
67

@@ -17,6 +18,33 @@ def setUp(self):
1718
r.close()
1819

1920

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+
2048
class TestODSWriter(ODSCellTypes):
2149
def setUp(self):
2250
r = ODSBook()

0 commit comments

Comments
 (0)