MCPcopy Index your code
hub / github.com/python-openxml/python-docx / it_knows_its_character_style

Method it_knows_its_character_style

tests/text/test_run.py:138–149  ·  view source on GitHub ↗
(
        self, part_prop_: Mock, document_part_: Mock, paragraph_: Mock
    )

Source from the content-addressed store, hash-verified

136 )
137
138 def it_knows_its_character_style(
139 self, part_prop_: Mock, document_part_: Mock, paragraph_: Mock
140 ):
141 style_ = document_part_.get_style.return_value
142 part_prop_.return_value = document_part_
143 style_id = "Barfoo"
144 run = Run(cast(CT_R, element(f"w:r/w:rPr/w:rStyle{{w:val={style_id}}}")), paragraph_)
145
146 style = run.style
147
148 document_part_.get_style.assert_called_once_with(style_id, WD_STYLE_TYPE.CHARACTER)
149 assert style is style_
150
151 @pytest.mark.parametrize(
152 ("r_cxml", "value", "style_id", "expected_cxml"),

Callers

nothing calls this directly

Calls 2

RunClass · 0.90
elementFunction · 0.85

Tested by

no test coverage detected