-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #2: it turns out that string and unicode do not need value field …
…in the cell. hence getting rid of it helps solve unicode encode error. it tried to do this and failed table:table-cell office:value-type=unicode office:string='Héllô'
- Loading branch information
Showing
2 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
#!/usr/bin/python | ||
# -*- encoding: utf-8 -*- | ||
import os | ||
from pyexcel_ods import get_data | ||
from pyexcel_ods import get_data, save_data | ||
|
||
|
||
def test_bug_fix_for_issue_1(): | ||
data = get_data(os.path.join("tests", "fixtures", "repeated.ods")) | ||
assert data['Sheet1'] == [['repeated', 'repeated', 'repeated', 'repeated']] | ||
|
||
def test_bug_fix_for_issue_2(): | ||
data = {} | ||
data.update({"Sheet 1": [[1, 2, 3], [4, 5, 6]]}) | ||
data.update({"Sheet 2": [[u"row 1", u"Héllô!", u"HolÁ!"]]}) | ||
save_data("your_file.ods", data) | ||
new_data = get_data("your_file.ods") | ||
assert new_data["Sheet 2"] == [[u'row 1', u'H\xe9ll\xf4!', u'Hol\xc1!']] |