@@ -42,6 +42,29 @@ def it_knows_whether_it_contains_a_page_break(
4242
4343 assert hyperlink .contains_page_break is expected_value
4444
45+ @pytest .mark .parametrize (
46+ ("hlink_cxml" , "count" ),
47+ [
48+ ("w:hyperlink" , 0 ),
49+ ("w:hyperlink/w:r" , 1 ),
50+ ("w:hyperlink/(w:r,w:r)" , 2 ),
51+ ("w:hyperlink/(w:r,w:lastRenderedPageBreak)" , 1 ),
52+ ("w:hyperlink/(w:lastRenderedPageBreak,w:r)" , 1 ),
53+ ("w:hyperlink/(w:r,w:lastRenderedPageBreak,w:r)" , 2 ),
54+ ],
55+ )
56+ def it_provides_access_to_the_runs_it_contains (
57+ self , hlink_cxml : str , count : int , fake_parent : t .StoryChild
58+ ):
59+ hlink = cast (CT_Hyperlink , element (hlink_cxml ))
60+ hyperlink = Hyperlink (hlink , fake_parent )
61+
62+ runs = hyperlink .runs
63+
64+ actual = [type (item ).__name__ for item in runs ]
65+ expected = ["Run" for _ in range (count )]
66+ assert actual == expected , f"expected: { expected } , got: { actual } "
67+
4568 # -- fixtures --------------------------------------------------------------------
4669
4770 @pytest .fixture
0 commit comments