-
-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added text alignment for textboxes. The existing options allowed the text area to be aligned but didn't offer control over the text within that area. Issue #684
- Loading branch information
Showing
6 changed files
with
82 additions
and
4 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,48 @@ | ||
############################################################################### | ||
# | ||
# Tests for XlsxWriter. | ||
# | ||
# Copyright (c), 2013-2020, John McNamara, jmcnamara@cpan.org | ||
# | ||
|
||
from ..excel_comparison_test import ExcelComparisonTest | ||
from ...workbook import Workbook | ||
|
||
|
||
class TestCompareXLSXFiles(ExcelComparisonTest): | ||
""" | ||
Test file created by XlsxWriter against a file created by Excel. | ||
""" | ||
|
||
def setUp(self): | ||
|
||
self.set_filename('textbox41.xlsx') | ||
|
||
def test_create_file(self): | ||
"""Test the creation of a simple XlsxWriter file with textbox(s).""" | ||
|
||
workbook = Workbook(self.got_filename) | ||
|
||
worksheet = workbook.add_worksheet() | ||
|
||
worksheet.insert_textbox('E9', 'This is some text') | ||
|
||
worksheet.insert_textbox('E19', 'This is some text', | ||
{'align': {'vertical': 'top', | ||
'horizontal': 'center', | ||
'text': 'left'}}) | ||
|
||
worksheet.insert_textbox('E29', 'This is some text', | ||
{'align': {'vertical': 'top', | ||
'horizontal': 'center', | ||
'text': 'center'}}) | ||
|
||
worksheet.insert_textbox('E39', 'This is some text', | ||
{'align': {'vertical': 'top', | ||
'horizontal': 'center', | ||
'text': 'right'}}) | ||
|
||
workbook.close() | ||
|
||
self.assertExcelEqual() |
Binary file not shown.