def core_properties(self): element = parse_xml( b'<?xml version=\'1.0\' encoding=\'UTF-8\' standalone=\'yes\'?>' b'\n<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.o' b'rg/package/2006/metadata/core-properties" xmlns:dc="http://pur' b'l.org/dc/elements/1.1/" xmlns:dcmitype="http://purl.org/dc/dcm' b'itype/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="h' b'ttp://www.w3.org/2001/XMLSchema-instance">\n' b' <cp:contentStatus>DRAFT</cp:contentStatus>\n' b' <dc:creator>python-docx</dc:creator>\n' b' <dcterms:created xsi:type="dcterms:W3CDTF">2012-11-17T11:07:' b'40-05:30</dcterms:created>\n' b' <dc:description/>\n' b' <dc:identifier>GXS 10.2.1ab</dc:identifier>\n' b' <dc:language>US-EN</dc:language>\n' b' <cp:lastPrinted>2014-06-04T04:28:00Z</cp:lastPrinted>\n' b' <cp:keywords>foo bar baz</cp:keywords>\n' b' <cp:lastModifiedBy>Steve Canny</cp:lastModifiedBy>\n' b' <cp:revision>4</cp:revision>\n' b' <dc:subject>Spam</dc:subject>\n' b' <dc:title>Word Document</dc:title>\n' b' <cp:version>1.2.88</cp:version>\n' b'</cp:coreProperties>\n' ) return CoreProperties(element)
def revision_set_fixture(self, request): value, str_val = request.param coreProperties = self.coreProperties(None, None) core_properties = CoreProperties(parse_xml(coreProperties)) expected_xml = self.coreProperties('cp:revision', str_val) return core_properties, value, expected_xml
def revision_get_fixture(self, request): str_val, expected_revision = request.param tagname = '' if str_val is None else 'cp:revision' coreProperties = self.coreProperties(tagname, str_val) core_properties = CoreProperties(parse_xml(coreProperties)) return core_properties, expected_revision
def date_prop_set_fixture(self, request): prop_name, tagname, value, str_val, attrs = request.param coreProperties = self.coreProperties(None, None) core_properties = CoreProperties(parse_xml(coreProperties)) expected_xml = self.coreProperties(tagname, str_val, attrs) return core_properties, prop_name, value, expected_xml