@@ -338,6 +338,11 @@ def it_knows_its_first_line_indent(self, first_indent_get_fixture):
338338 paragraph_format , expected_value = first_indent_get_fixture
339339 assert paragraph_format .first_line_indent == expected_value
340340
341+ def it_can_change_its_first_line_indent (self , first_indent_set_fixture ):
342+ paragraph_format , value , expected_xml = first_indent_set_fixture
343+ paragraph_format .first_line_indent = value
344+ assert paragraph_format ._element .xml == expected_xml
345+
341346 def it_knows_its_left_indent (self , left_indent_get_fixture ):
342347 paragraph_format , expected_value = left_indent_get_fixture
343348 assert paragraph_format .left_indent == expected_value
@@ -388,6 +393,24 @@ def first_indent_get_fixture(self, request):
388393 paragraph_format = ParagraphFormat (element (p_cxml ))
389394 return paragraph_format , expected_value
390395
396+ @pytest .fixture (params = [
397+ ('w:p' , Pt (36 ), 'w:p/w:pPr/w:ind{w:firstLine=720}' ),
398+ ('w:p' , Pt (- 36 ), 'w:p/w:pPr/w:ind{w:hanging=720}' ),
399+ ('w:p' , 0 , 'w:p/w:pPr/w:ind{w:firstLine=0}' ),
400+ ('w:p' , None , 'w:p/w:pPr' ),
401+ ('w:p/w:pPr/w:ind{w:firstLine=240}' , None ,
402+ 'w:p/w:pPr/w:ind' ),
403+ ('w:p/w:pPr/w:ind{w:firstLine=240}' , Pt (- 18 ),
404+ 'w:p/w:pPr/w:ind{w:hanging=360}' ),
405+ ('w:p/w:pPr/w:ind{w:hanging=240}' , Pt (18 ),
406+ 'w:p/w:pPr/w:ind{w:firstLine=360}' ),
407+ ])
408+ def first_indent_set_fixture (self , request ):
409+ p_cxml , value , expected_p_cxml = request .param
410+ paragraph_format = ParagraphFormat (element (p_cxml ))
411+ expected_xml = xml (expected_p_cxml )
412+ return paragraph_format , value , expected_xml
413+
391414 @pytest .fixture (params = [
392415 ('w:p' , None ),
393416 ('w:p/w:pPr' , None ),
0 commit comments