Skip to content

Commit 5cc787a

Browse files
committed
Merge branch 'master' of http://github.com/chfw/pyexcel-ods3
2 parents 75266b7 + 19ee703 commit 5cc787a

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ python:
99
- 3.4
1010
install:
1111
- pip install git+https://github.com/chfw/ezodf.git
12+
- pip install git+https://github.com/chfw/pyexcel.git
1213
- pip install -r requirements.txt --use-mirrors
1314
- pip install -r tests/requirements.txt --use-mirrors
1415
script:

README.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,10 @@ Test coverage
205205
==============
206206

207207
`code coverage <https://codecov.io/github/chfw/pyexcel-ods3>`_
208+
209+
.. testcode::
210+
:hide:
211+
212+
>>> import os
213+
>>> os.unlink("your_file.ods")
214+
>>> os.unlink("another_file.ods")

tests/base.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def test_write_reader(self):
7070
w2.write_reader(r)
7171
w2.close()
7272
r2 = pyexcel.Reader(self.testfile2)
73+
r2.format(int)
7374
actual = pyexcel.utils.to_array(r2.rows())
7475
assert actual == self.content
7576

@@ -106,7 +107,7 @@ def test_reading_through_sheets(self):
106107
expected = [[u'X', u'Y', u'Z'], [1, 4, 7], [2, 5, 8], [3, 6, 9]]
107108
assert data == expected
108109
sheet3 = b["Sheet3"]
109-
sheet3.become_series()
110+
sheet3.name_columns_by_row(0)
110111
data = pyexcel.utils.to_array(b["Sheet3"].rows())
111112
expected = [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
112113
assert data == expected
@@ -137,14 +138,12 @@ def test_write_a_book_reader(self):
137138

138139
def test_random_access_operator(self):
139140
r = pyexcel.BookReader(self.testfile)
140-
value = r["Sheet1"][0][1]
141+
value = r["Sheet1"][0,1]
141142
assert value == 1
142-
value = r["Sheet3"][0][1]
143-
assert value == 'Y'
144-
value = r["Sheet3"].become_series()[0][1]
145-
assert value == 4
146-
value = r["Sheet3"].become_sheet()[0][1]
143+
value = r["Sheet3"][0,1]
147144
assert value == 'Y'
145+
r["Sheet3"].name_columns_by_row(0)
146+
assert r["Sheet3"][0,1] == 4
148147

149148

150149
class ODSCellTypes:

tests/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pyexcel
1+
pyexcel-xl
22
nose
33
rednose
44
nose-cov

tests/test_mutliple_sheets.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import pyexcel
33
import os
44
from pyexcel.ext import ods3
5+
from pyexcel.ext import xl
56
from base import create_sample_file1
67

78

@@ -62,7 +63,7 @@ def setUp(self):
6263
self._write_test_file(self.testfile2)
6364

6465
def test_delete_sheets(self):
65-
b1 = pyexcel.readers.Book(self.testfile)
66+
b1 = pyexcel.load_book(self.testfile)
6667
assert len(b1.sheet_names()) == 3
6768
del b1["Sheet1"]
6869
assert len(b1.sheet_names()) == 2
@@ -81,7 +82,7 @@ def test_delete_sheets(self):
8182

8283
def test_delete_sheets2(self):
8384
"""repetitively delete first sheet"""
84-
b1 = pyexcel.readers.Book(self.testfile)
85+
b1 = pyexcel.load_book(self.testfile)
8586
del b1[0]
8687
assert len(b1.sheet_names()) == 2
8788
del b1[0]

0 commit comments

Comments
 (0)