def it_can_change_its_start_type(self, start_type_set_fixture): sectPr, new_start_type, expected_xml = start_type_set_fixture section = Section(sectPr, None) section.start_type = new_start_type assert section._sectPr.xml == expected_xml
def it_can_change_its_orientation(self, orientation_set_fixture): sectPr, new_orientation, expected_xml = orientation_set_fixture section = Section(sectPr, None) section.orientation = new_orientation assert section._sectPr.xml == expected_xml
def it_can_change_its_page_height(self, page_height_set_fixture): sectPr, new_page_height, expected_xml = page_height_set_fixture section = Section(sectPr, None) section.page_height = new_page_height assert section._sectPr.xml == expected_xml
def it_can_change_its_page_width(self, page_width_set_fixture): sectPr, new_page_width, expected_xml = page_width_set_fixture section = Section(sectPr, None) section.page_width = new_page_width assert section._sectPr.xml == expected_xml
def it_can_change_whether_the_document_has_distinct_odd_and_even_headers( self, diff_first_header_set_fixture): sectPr, value, expected_xml = diff_first_header_set_fixture section = Section(sectPr, None) section.different_first_page_header_footer = value assert sectPr.xml == expected_xml
def it_can_change_its_page_margins(self, margins_set_fixture): sectPr, margin_prop_name, new_value, expected_xml = margins_set_fixture section = Section(sectPr, None) setattr(section, margin_prop_name, new_value) assert section._sectPr.xml == expected_xml
def it_knows_its_page_margins(self, margins_get_fixture): sectPr, margin_prop_name, expected_value = margins_get_fixture section = Section(sectPr, None) value = getattr(section, margin_prop_name) assert value == expected_value
def it_knows_its_page_orientation(self, orientation_get_fixture): sectPr, expected_orientation = orientation_get_fixture section = Section(sectPr, None) orientation = section.orientation assert orientation is expected_orientation
def it_knows_its_page_height(self, page_height_get_fixture): sectPr, expected_page_height = page_height_get_fixture section = Section(sectPr, None) page_height = section.page_height assert page_height == expected_page_height
def it_knows_its_page_width(self, page_width_get_fixture): sectPr, expected_page_width = page_width_get_fixture section = Section(sectPr, None) page_width = section.page_width assert page_width == expected_page_width
def it_knows_its_start_type(self, start_type_get_fixture): sectPr, expected_start_type = start_type_get_fixture section = Section(sectPr, None) start_type = section.start_type assert start_type is expected_start_type
def it_knows_when_it_displays_a_distinct_first_page_header( self, diff_first_header_get_fixture): sectPr, expected_value = diff_first_header_get_fixture section = Section(sectPr, None) different_first_page_header_footer = section.different_first_page_header_footer assert different_first_page_header_footer is expected_value
def it_provides_access_to_its_default_header(self, document_part_, _Header_, header_): sectPr = element('w:sectPr') _Header_.return_value = header_ section = Section(sectPr, document_part_) header = section.header _Header_.assert_called_once_with(sectPr, document_part_, WD_HEADER_FOOTER.PRIMARY) assert header is header_
def it_provides_access_to_its_default_footer(self, document_part_, _Footer_, footer_): sectPr = element('w:sectPr') _Footer_.return_value = footer_ section = Section(sectPr, document_part_) footer = section.footer _Footer_.assert_called_once_with(sectPr, document_part_, WD_HEADER_FOOTER.PRIMARY) assert footer is footer_
def it_provides_access_to_its_first_page_header(self, document_part_, _Header_, header_): sectPr = element("w:sectPr") _Header_.return_value = header_ section = Section(sectPr, document_part_) header = section.first_page_header _Header_.assert_called_once_with(sectPr, document_part_, WD_HEADER_FOOTER.FIRST_PAGE) assert header is header_