Esempio n. 1
0
 def iter_fixture(self, request, TabStop_, tab_stop_):
     pPr_cxml, expected_count = request.param
     pPr = element(pPr_cxml)
     tab_elms = pPr.xpath('//w:tab')
     tab_stops = TabStops(pPr)
     expected_calls = [call(tab) for tab in tab_elms]
     return tab_stops, expected_count, tab_stop_, TabStop_, expected_calls
Esempio n. 2
0
 def tab_stops(self):
     """
     |TabStops| object providing access to the tab stops defined for this
     paragraph format.
     """
     pPr = self._element.get_or_add_pPr()
     return TabStops(pPr)
Esempio n. 3
0
 def len_fixture(self, request):
     tab_stops_cxml, expected_value = request.param
     tab_stops = TabStops(element(tab_stops_cxml))
     return tab_stops, expected_value
Esempio n. 4
0
 def index_fixture(self, request, TabStop_, tab_stop_):
     pPr_cxml, idx = request.param
     pPr = element(pPr_cxml)
     tab = pPr.xpath('./w:tabs/w:tab')[idx]
     tab_stops = TabStops(pPr)
     return tab_stops, idx, TabStop_, tab, tab_stop_
Esempio n. 5
0
 def add_tab_fixture(self, request):
     pPr_cxml, position, kwargs, expected_cxml = request.param
     tab_stops = TabStops(element(pPr_cxml))
     expected_xml = xml(expected_cxml)
     return tab_stops, position, kwargs, expected_xml
Esempio n. 6
0
 def del_raises_fixture(self, request):
     tab_stops_cxml, idx = request.param
     tab_stops = TabStops(element(tab_stops_cxml))
     return tab_stops, idx
Esempio n. 7
0
 def del_fixture(self, request):
     pPr_cxml, idx, expected_cxml = request.param
     tab_stops = TabStops(element(pPr_cxml))
     expected_xml = xml(expected_cxml)
     return tab_stops, idx, expected_xml
Esempio n. 8
0
 def clear_all_fixture(self, request):
     pPr_cxml = request.param
     tab_stops = TabStops(element(pPr_cxml))
     expected_xml = xml('w:pPr')
     return tab_stops, expected_xml
Esempio n. 9
0
 def it_raises_on_indexed_access_when_empty(self):
     tab_stops = TabStops(element('w:pPr'))
     with pytest.raises(IndexError):
         tab_stops[0]