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
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)
def len_fixture(self, request): tab_stops_cxml, expected_value = request.param tab_stops = TabStops(element(tab_stops_cxml)) return tab_stops, expected_value
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_
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
def del_raises_fixture(self, request): tab_stops_cxml, idx = request.param tab_stops = TabStops(element(tab_stops_cxml)) return tab_stops, idx
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
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
def it_raises_on_indexed_access_when_empty(self): tab_stops = TabStops(element('w:pPr')) with pytest.raises(IndexError): tab_stops[0]