(
self,
sentinel_cxml: str,
start_type: WD_SECTION,
new_sentinel_cxml: str,
Section_: Mock,
section_: Mock,
document_part_: Mock,
)
| 136 | ], |
| 137 | ) |
| 138 | def it_can_add_a_section( |
| 139 | self, |
| 140 | sentinel_cxml: str, |
| 141 | start_type: WD_SECTION, |
| 142 | new_sentinel_cxml: str, |
| 143 | Section_: Mock, |
| 144 | section_: Mock, |
| 145 | document_part_: Mock, |
| 146 | ): |
| 147 | Section_.return_value = section_ |
| 148 | document = Document( |
| 149 | cast(CT_Document, element("w:document/w:body/(w:p,%s)" % sentinel_cxml)), |
| 150 | document_part_, |
| 151 | ) |
| 152 | |
| 153 | section = document.add_section(start_type) |
| 154 | |
| 155 | assert document.element.xml == xml( |
| 156 | "w:document/w:body/(w:p,w:p/w:pPr/%s,%s)" % (sentinel_cxml, new_sentinel_cxml) |
| 157 | ) |
| 158 | sectPr = document.element.xpath("w:body/w:sectPr")[0] |
| 159 | Section_.assert_called_once_with(sectPr, document_part_) |
| 160 | assert section is section_ |
| 161 | |
| 162 | def it_can_add_a_table( |
| 163 | self, |
nothing calls this directly
no test coverage detected