99 absolute_import , division , print_function , unicode_literals
1010)
1111
12+ from docx .enum .text import WD_TAB_ALIGNMENT
1213from docx .shared import Twips
1314from docx .text .tabstops import TabStop , TabStops
1415
@@ -24,8 +25,22 @@ def it_knows_its_position(self, position_get_fixture):
2425 tab_stop , expected_value = position_get_fixture
2526 assert tab_stop .position == expected_value
2627
28+ def it_knows_its_alignment (self , alignment_get_fixture ):
29+ tab_stop , expected_value = alignment_get_fixture
30+ assert tab_stop .alignment == expected_value
31+
2732 # fixture --------------------------------------------------------
2833
34+ @pytest .fixture (params = [
35+ ('w:tab{w:val=left}' , 'LEFT' ),
36+ ('w:tab{w:val=right}' , 'RIGHT' ),
37+ ])
38+ def alignment_get_fixture (self , request ):
39+ tab_stop_cxml , member = request .param
40+ tab_stop = TabStop (element (tab_stop_cxml ))
41+ expected_value = getattr (WD_TAB_ALIGNMENT , member )
42+ return tab_stop , expected_value
43+
2944 @pytest .fixture
3045 def position_get_fixture (self , request ):
3146 tab_stop = TabStop (element ('w:tab{w:pos=720}' ))
0 commit comments