Beispiel #1
0
 def testExtendedPropertyToAndFromXml(self):
     ep = gdata.calendar.ExtendedProperty(name='test')
     ep.value = 'val'
     xml_string = ep.ToString()
     ep2 = gdata.ExtendedPropertyFromString(xml_string)
     self.assertEquals(ep.name, ep2.name)
     self.assertEquals(ep.value, ep2.value)
    def testXmlBlobRoundTrip(self):
        ep = gdata.ExtendedProperty(name='blobby')
        ep.SetXmlBlob('<some_xml attr="test"/>')
        extension = ep.GetXmlBlobExtensionElement()
        self.assertEquals(extension.tag, 'some_xml')
        self.assert_(extension.namespace is None)
        self.assertEquals(extension.attributes['attr'], 'test')

        ep2 = gdata.ExtendedPropertyFromString(ep.ToString())

        extension = ep2.GetXmlBlobExtensionElement()
        self.assertEquals(extension.tag, 'some_xml')
        self.assert_(extension.namespace is None)
        self.assertEquals(extension.attributes['attr'], 'test')