-
-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for formula string values. Issue #122.
- Loading branch information
Showing
5 changed files
with
82 additions
and
30 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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
############################################################################### | ||
# | ||
# Tests for XlsxWriter. | ||
# | ||
# Copyright (c), 2013-2014, John McNamara, jmcnamara@cpan.org | ||
# | ||
|
||
import unittest | ||
import os | ||
from ...workbook import Workbook | ||
from ..helperfunctions import _compare_xlsx_files | ||
|
||
|
||
class TestCompareXLSXFiles(unittest.TestCase): | ||
""" | ||
Test file created by XlsxWriter against a file created by Excel. | ||
""" | ||
|
||
def setUp(self): | ||
self.maxDiff = None | ||
|
||
filename = 'types06.xlsx' | ||
|
||
test_dir = 'xlsxwriter/test/comparison/' | ||
self.got_filename = test_dir + '_test_' + filename | ||
self.exp_filename = test_dir + 'xlsx_files/' + filename | ||
|
||
self.ignore_files = ['xl/calcChain.xml', | ||
'[Content_Types].xml', | ||
'xl/_rels/workbook.xml.rels'] | ||
self.ignore_elements = {} | ||
|
||
def test_write_formula_default(self): | ||
"""Test writing formulas with strings_to_formulas on.""" | ||
filename = self.got_filename | ||
|
||
#################################################### | ||
|
||
workbook = Workbook(filename) | ||
worksheet = workbook.add_worksheet() | ||
|
||
worksheet.write(0, 0, '="0"&".0"', None, '0.0') | ||
|
||
workbook.close() | ||
|
||
#################################################### | ||
|
||
got, exp = _compare_xlsx_files(self.got_filename, | ||
self.exp_filename, | ||
self.ignore_files, | ||
self.ignore_elements) | ||
|
||
self.assertEqual(got, exp) | ||
|
||
def tearDown(self): | ||
# Cleanup. | ||
if os.path.exists(self.got_filename): | ||
os.remove(self.got_filename) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
Binary file not shown.
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