def test_cmp_collation(self): el = ET.Element('someel') el.text = b"foobar" el.set('collation', 'i;octet') self.assertFalse(caldav.apply_text_match(el, b"FOOBAR")) self.assertTrue(caldav.apply_text_match(el, b"foobar")) self.assertFalse(caldav.apply_text_match(el, b"fobar"))
def test_one(self): self.assertEqual([ b'<ns0:propstat xmlns:ns0="DAV:"><ns0:status>HTTP/1.1 200 ' b'OK</ns0:status><ns0:prop><foo /></ns0:prop></ns0:propstat>' ], [ ET.tostring(x) for x in webdav.propstat_as_xml( [webdav.PropStatus('200 OK', None, ET.Element('foo'))]) ])
def setUp(self): super(ExtractfromCalendarTests, self).setUp() self.requested = ET.Element('{%s}calendar-data' % caldav.NAMESPACE)
def test_default_collation(self): el = ET.Element('someel') el.text = b"foobar" self.assertTrue(caldav.apply_text_match(el, b"FOOBAR")) self.assertTrue(caldav.apply_text_match(el, b"foobar")) self.assertFalse(caldav.apply_text_match(el, b"fobar"))
def test_unknown_collation(self): el = ET.Element('someel') el.set('collation', 'i;blah') el.text = b"foobar" self.assertRaises(davcommon.UnknownCollation, caldav.apply_text_match, el, b"FOOBAR")