File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,15 @@ def new():
3636 p = oxml_fromstring (xml )
3737 return p
3838
39+ @property
40+ def r_elms (self ):
41+ """
42+ Sequence containing a reference to each run element in this paragraph.
43+ """
44+ if not hasattr (self , 'r' ):
45+ return ()
46+ return tuple ([r for r in self .r ])
47+
3948
4049class CT_R (OxmlBaseElement ):
4150 """
Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ def it_can_construct_a_new_p_element(self):
2121 expected_xml = a_p ().with_nsdecls ().xml
2222 assert p .xml == expected_xml
2323
24+ def it_has_a_sequence_of_the_runs_it_contains (self ):
25+ p = a_p ().with_nsdecls ().with_r (3 ).element
26+ assert len (p .r_elms ) == 3
27+ for r in p .r_elms :
28+ assert isinstance (r , CT_R )
29+
2430 def it_can_add_an_r_to_itself (self ):
2531 p = a_p ().with_nsdecls ().element
2632 # exercise -----------------
You can’t perform that action at this time.
0 commit comments