[Zope3-checkins] SVN: Zope3/branches/isarsprint-dav-work/src/zope/app/dav/ Functional test for opaque properties; this revealed that I did need to specify

Martijn Pieters mj at zopatista.com
Wed Oct 13 07:05:25 EDT 2004


Log message for revision 28059:
  Functional test for opaque properties; this revealed that I did need to specify
  the convenience methods on the interface in order for them to be accessible.
  

Changed:
  U   Zope3/branches/isarsprint-dav-work/src/zope/app/dav/ftests/test_propfind.py
  U   Zope3/branches/isarsprint-dav-work/src/zope/app/dav/opaquenamespaces.py

-=-
Modified: Zope3/branches/isarsprint-dav-work/src/zope/app/dav/ftests/test_propfind.py
===================================================================
--- Zope3/branches/isarsprint-dav-work/src/zope/app/dav/ftests/test_propfind.py	2004-10-13 10:47:10 UTC (rev 28058)
+++ Zope3/branches/isarsprint-dav-work/src/zope/app/dav/ftests/test_propfind.py	2004-10-13 11:05:24 UTC (rev 28059)
@@ -23,6 +23,7 @@
 from zope.app import zapi
 from zope.app.dav.ftests.dav import DAVTestCase
 from zope.app.dublincore.interfaces import IZopeDublinCore
+from zope.app.dav.opaquenamespaces import IDAVOpaqueNamespaces
 from zope.app.traversing.api import traverse
 
 class TestPROPFIND(DAVTestCase):
@@ -60,6 +61,16 @@
         expect = ', '.join(adapted.subjects)
         self.verifyPropOK(path='/pt', ns='http://purl.org/dc/1.1',
                           prop='subjects', expect=expect, basic='mgr:mgrpw')
+        
+    def test_opaque(self):
+        self.addPage('/pt', u'<span />')
+        pt = traverse(self.getRootFolder(), '/pt')
+        adapted = IDAVOpaqueNamespaces(pt)
+        adapted[u'uri://bar'] = {u'foo': '<foo>spam</foo>'}
+        get_transaction().commit()
+        expect = 'spam'
+        self.verifyPropOK(path='/pt', ns='uri://bar',
+                          prop='foo', expect=expect, basic='mgr:mgrpw')
 
     def verifyPropOK(self, path, ns, prop, expect, basic):
         body = """<?xml version="1.0" ?>

Modified: Zope3/branches/isarsprint-dav-work/src/zope/app/dav/opaquenamespaces.py
===================================================================
--- Zope3/branches/isarsprint-dav-work/src/zope/app/dav/opaquenamespaces.py	2004-10-13 10:47:10 UTC (rev 28058)
+++ Zope3/branches/isarsprint-dav-work/src/zope/app/dav/opaquenamespaces.py	2004-10-13 11:05:24 UTC (rev 28059)
@@ -44,6 +44,24 @@
     actual opaque value, of the form (((attr1, val1), (attr2, val2)), value) 
     
     """
+    
+    def renderProperty(ns, nsprefix, prop, propel):
+        """Render the named property to a DOM subtree
+        
+        ns and prop are keys defining the property, nsprefix is the namespace
+        prefix used in the DOM for the namespace of the property, and propel
+        is the <prop> element in the target DOM to which the property DOM 
+        elements need to be added.
+        
+        """
+        
+    def setProperty(propel):
+        """Store a DOM property in the opaque storage
+        
+        propel is expected to be a DOM element from which the namespace and
+        property name are taken to be stored.
+        
+        """
 
     
 class DAVOpaqueNamespacesAdapter(DictMixin, Location):



More information about the Zope3-Checkins mailing list