def setUp(self): tr_xml = ( '<a:tr %s h="370840"><a:tc><a:txBody><a:p/></a:txBody></a:tc><a:t' 'c><a:txBody><a:p/></a:txBody></a:tc></a:tr>' % nsdecls('a') ) test_tr_elm = parse_xml_bytes(tr_xml) self.cells = _CellCollection(test_tr_elm, None)
def len_fixture(self, request): tr_cxml, expected_len = request.param cells = _CellCollection(element(tr_cxml), None) return cells, expected_len
def iter_fixture(self, request): tr_cxml = request.param tr = element(tr_cxml) cells = _CellCollection(tr, None) expected_cell_lst = tr.findall(qn('a:tc')) return cells, expected_cell_lst
def it_raises_on_indexed_access_out_of_range(self): cells = _CellCollection(element('a:tr/a:tc'), None) with pytest.raises(IndexError): cells[-1] with pytest.raises(IndexError): cells[9]