예제 #1
0
 def it_can_construct_a_default_styles_part_to_help(self):
     package = OpcPackage()
     styles_part = StylesPart.default(package)
     assert isinstance(styles_part, StylesPart)
     assert styles_part.partname == '/word/styles.xml'
     assert styles_part.content_type == CT.WML_STYLES
     assert styles_part.package is package
     assert len(styles_part.element) == 6
예제 #2
0
 def it_can_construct_a_default_styles_part_to_help(self):
     package = OpcPackage()
     styles_part = StylesPart.default(package)
     assert isinstance(styles_part, StylesPart)
     assert styles_part.partname == '/word/styles.xml'
     assert styles_part.content_type == CT.WML_STYLES
     assert styles_part.package is package
     assert len(styles_part.element) == 6
예제 #3
0
 def _styles_part(self):
     """
     Instance of |StylesPart| for this document. Creates an empty styles
     part if one is not present.
     """
     try:
         return self.part_related_by(RT.STYLES)
     except KeyError:
         styles_part = StylesPart.default(self.package)
         self.relate_to(styles_part, RT.STYLES)
         return styles_part
예제 #4
0
 def _styles_part(self):
     """
     Instance of |StylesPart| for this document. Creates an empty styles
     part if one is not present.
     """
     try:
         return self.part_related_by(RT.STYLES)
     except KeyError:
         styles_part = StylesPart.default(self.package)
         self.relate_to(styles_part, RT.STYLES)
         return styles_part