@@ -47,18 +47,32 @@ def it_knows_its_display_dimensions(self, dimensions_get_fixture):
4747 assert isinstance (height , _BaseLength )
4848 assert height == cy
4949
50+ def it_can_change_its_display_dimensions (self , dimensions_set_fixture ):
51+ inline_shape , cx , cy , expected_xml = dimensions_set_fixture
52+ inline_shape .width = cx
53+ inline_shape .height = cy
54+ assert inline_shape ._inline .xml == expected_xml
55+
5056 # fixtures -------------------------------------------------------
5157
5258 @pytest .fixture
5359 def dimensions_get_fixture (self ):
5460 cx , cy = 333 , 666
55- inline = (
56- an_inline ().with_nsdecls ().with_child (
57- an_extent ().with_cx (cx ).with_cy (cy ))
58- ).element
61+ inline = self ._inline_bldr_with_dimensions (cx , cy ).element
5962 inline_shape = InlineShape (inline )
6063 return inline_shape , cx , cy
6164
65+ @pytest .fixture
66+ def dimensions_set_fixture (self ):
67+ # inline_shape -----------------
68+ cx , cy = 333 , 666
69+ inline = self ._inline_bldr_with_dimensions (cx , cy ).element
70+ inline_shape = InlineShape (inline )
71+ # expected_xml -----------------
72+ cx , cy = cx + 111 , cy + 222
73+ expected_xml = self ._inline_bldr_with_dimensions (cx , cy ).xml ()
74+ return inline_shape , cx , cy , expected_xml
75+
6276 @pytest .fixture
6377 def image_params (self ):
6478 filename = 'foobar.garf'
@@ -127,6 +141,12 @@ def shape_type_fixture(self, request):
127141
128142 return InlineShape (inline ), shape_type
129143
144+ def _inline_bldr_with_dimensions (self , cx , cy ):
145+ return (
146+ an_inline ().with_nsdecls ().with_child (
147+ an_extent ().with_cx (cx ).with_cy (cy ))
148+ )
149+
130150 def _inline_with_picture (self , embed = False , link = False ):
131151 picture_ns = nsmap ['pic' ]
132152
0 commit comments