[Zope-CVS] SVN: zversioning/trunk/src/versioning/demo/ some tests added

Volker Bachschneider vbachs at dzug.org
Tue Oct 12 12:02:57 EDT 2004


Log message for revision 28012:
  some tests added
  


Changed:
  U   zversioning/trunk/src/versioning/demo/tests.py
  U   zversioning/trunk/src/versioning/demo/vproposal.txt


-=-
Modified: zversioning/trunk/src/versioning/demo/tests.py
===================================================================
--- zversioning/trunk/src/versioning/demo/tests.py	2004-10-12 15:46:59 UTC (rev 28011)
+++ zversioning/trunk/src/versioning/demo/tests.py	2004-10-12 16:02:55 UTC (rev 28012)
@@ -1,5 +1,25 @@
 import unittest
-from zope.testing.doctest import DocFileSuite
+from zope.testing.doctest import DocFileSuite, DocTestSuite
+from zope.app.tests import placelesssetup
+from zope.app.tests import ztapi
+
+from vproposal import VProposal
+from zope.app.tests.setup import setUpAnnotations
+from zope.app.annotation.interfaces import IAnnotatable, IAttributeAnnotatable
+from zope.app.dublincore.interfaces import IZopeDublinCore
+from zope.app.dublincore.annotatableadapter import ZDCAnnotatableAdapter
+from zope.interface.declarations import classImplements
+
+def setUp(test):
+    placelesssetup.setUp(test)
+    setUpAnnotations()
+    ztapi.provideAdapter(IAnnotatable, IZopeDublinCore,
+                         ZDCAnnotatableAdapter)
+    classImplements(VProposal,IAttributeAnnotatable)    
  
 def test_suite():
-    return DocFileSuite('vproposal.txt')
\ No newline at end of file
+    suite = unittest.TestSuite()
+    suite.addTest(DocFileSuite('vproposal.txt',setUp=setUp,
+                                tearDown=placelesssetup.tearDown))
+    return suite
+

Modified: zversioning/trunk/src/versioning/demo/vproposal.txt
===================================================================
--- zversioning/trunk/src/versioning/demo/vproposal.txt	2004-10-12 15:46:59 UTC (rev 28011)
+++ zversioning/trunk/src/versioning/demo/vproposal.txt	2004-10-12 16:02:55 UTC (rev 28012)
@@ -10,9 +10,29 @@
 
 You create it calling the 'VProposal' class:
 
-
+  >>> from versioning.demo.vproposal import VProposal
+  >>> myproposal = VProposal('Titel','Concept')
+ 
 Access the content and title via attributes:
- 
 
+  >>> myproposal.title
+  u'Titel'
+  >>>
+
+As you see everything is unicode
+'Titel' is stored in the Annotations, hereby dublincore
+So we have a getter and setter for that:
+
+  >>> myproposal.getTitle()
+  u'Titel'
+  >>> 
+
 All data in the 'VProposal' class defaults to a empty string:
 
+  >>> myproposal = VProposal()
+  >>> myproposal.title, myproposal.usecase, myproposal.concept
+  (u'', u'', u'')
+  >>>
+  >>> myproposal.todo, myproposal.issues
+  (u'', u'')
+  >>>



More information about the Zope-CVS mailing list