-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
oxml: add .inner_content_elements props
- Loading branch information
Showing
6 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"""Unit-test suite for `docx.oxml.document` module.""" | ||
|
||
from __future__ import annotations | ||
|
||
from typing import cast | ||
|
||
from docx.oxml.document import CT_Body | ||
from docx.oxml.table import CT_Tbl | ||
from docx.oxml.text.paragraph import CT_P | ||
|
||
from ..unitutil.cxml import element | ||
|
||
|
||
class DescribeCT_Body: | ||
"""Unit-test suite for selected units of `docx.oxml.document.CT_Body`.""" | ||
|
||
def it_knows_its_inner_content_block_item_elements(self): | ||
body = cast(CT_Body, element("w:body/(w:tbl, w:p,w:p)")) | ||
assert [type(e) for e in body.inner_content_elements] == [CT_Tbl, CT_P, CT_P] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"""Unit-test suite for `docx.oxml.section` module.""" | ||
|
||
from __future__ import annotations | ||
|
||
from typing import cast | ||
|
||
from docx.oxml.section import CT_HdrFtr | ||
from docx.oxml.table import CT_Tbl | ||
from docx.oxml.text.paragraph import CT_P | ||
|
||
from ..unitutil.cxml import element | ||
|
||
|
||
class DescribeCT_HdrFtr: | ||
"""Unit-test suite for selected units of `docx.oxml.section.CT_HdrFtr`.""" | ||
|
||
def it_knows_its_inner_content_block_item_elements(self): | ||
hdr = cast(CT_HdrFtr, element("w:hdr/(w:tbl,w:tbl,w:p)")) | ||
assert [type(e) for e in hdr.inner_content_elements] == [CT_Tbl, CT_Tbl, CT_P] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters