@@ -23,6 +23,12 @@ def given_a_Section_object_as_section(context):
2323 context .section = Document (test_docx ("sct-section-props" )).sections [- 1 ]
2424
2525
26+ @given ("a Section object {with_or_without} a distinct first-page header as section" )
27+ def given_a_Section_object_with_or_without_first_page_header (context , with_or_without ):
28+ section_idx = {"with" : 1 , "without" : 0 }[with_or_without ]
29+ context .section = Document (test_docx ("sct-first-page-hdrftr" )).sections [section_idx ]
30+
31+
2632@given ('a section collection containing 3 sections' )
2733def given_a_section_collection_containing_3_sections (context ):
2834 document = Document (test_docx ('doc-access-sections' ))
@@ -66,6 +72,11 @@ def given_a_section_having_known_orientation(context, orientation):
6672
6773# when =====================================================
6874
75+ @when ("I assign {bool_val} to section.different_first_page_header_footer" )
76+ def when_I_assign_value_to_section_different_first_page_hdrftr (context , bool_val ):
77+ context .section .different_first_page_header_footer = eval (bool_val )
78+
79+
6980@when ('I set the {margin_side} margin to {inches} inches' )
7081def when_I_set_the_margin_side_length (context , margin_side , inches ):
7182 prop_name = {
@@ -142,6 +153,15 @@ def then_len_sections_is_3(context):
142153 )
143154
144155
156+ @then ("section.different_first_page_header_footer is {bool_val}" )
157+ def then_section_different_first_page_header_footer_is (context , bool_val ):
158+ actual = context .section .different_first_page_header_footer
159+ expected = eval (bool_val )
160+ assert actual == expected , (
161+ "section.different_first_page_header_footer is %s" % actual
162+ )
163+
164+
145165@then ("section.footer is a _Footer object" )
146166def then_section_footer_is_a_Footer_object (context ):
147167 actual = type (context .section .footer ).__name__
0 commit comments