[Zope3-checkins] SVN: Zope3/trunk/src/buddydemo/ Started converting the buddydemo to use doc files.

Jim Fulton jim at zope.com
Mon Aug 30 16:20:41 EDT 2004


Log message for revision 27354:
  Started converting the buddydemo to use doc files.
  


Changed:
  U   Zope3/trunk/src/buddydemo/buddy.py
  A   Zope3/trunk/src/buddydemo/buddy.txt
  U   Zope3/trunk/src/buddydemo/tests.py


-=-
Modified: Zope3/trunk/src/buddydemo/buddy.py
===================================================================
--- Zope3/trunk/src/buddydemo/buddy.py	2004-08-30 13:59:05 UTC (rev 27353)
+++ Zope3/trunk/src/buddydemo/buddy.py	2004-08-30 20:20:41 UTC (rev 27354)
@@ -7,22 +7,6 @@
 
 class Buddy(persistent.Persistent):
     """Buddy information
-
-    >>> bud = Buddy('Bob', 'Smith', 'bob at smith.org',
-    ...             '513 Princess Ann Street', '22401')
-    >>> bud.first, bud.last, bud.email
-    ('Bob', 'Smith', 'bob at smith.org')
-    >>> bud.address, bud.postal_code
-    ('513 Princess Ann Street', '22401')
-
-    Any data not passed to the class are initialized to
-    empty strings:
-
-    >>> bud = Buddy()
-    >>> bud.first, bud.last, bud.email
-    ('', '', '')
-    >>> bud.address, bud.postal_code
-    ('', '')
     """
 
     zope.interface.implements(IBuddy, IBuddyContained)
@@ -36,12 +20,6 @@
         self.address, self.postal_code = address, pc
 
     def name(self):
-        """Get the full name of a buddy
-
-        >>> bud = Buddy('Bob', 'Smith')
-        >>> bud.name()
-        'Bob Smith'
-        """
         return "%s %s" % (self.first, self.last)
 
 from zope.app.container.btree import BTreeContainer

Copied: Zope3/trunk/src/buddydemo/buddy.txt (from rev 27322, Zope3/trunk/src/buddydemo/buddy.py)
===================================================================
--- Zope3/trunk/src/buddydemo/buddy.py	2004-08-28 00:59:04 UTC (rev 27322)
+++ Zope3/trunk/src/buddydemo/buddy.txt	2004-08-30 20:20:41 UTC (rev 27354)
@@ -0,0 +1,39 @@
+Buddies
+=======
+
+Buddies provide basic contact information:
+
+- First name
+- Last name
+- Email address
+- Street adress, and
+- postal code
+
+Buddies can be created by calling the `Buddy` class:
+
+  >>> from buddydemo.buddy import Buddy
+  >>> bud = Buddy('Bob', 'Smith', 'bob at smith.org',
+  ...             '513 Princess Ann Street', '22401')
+
+You can access the information via attributes:
+
+  >>> bud.first, bud.last, bud.email
+  ('Bob', 'Smith', 'bob at smith.org')
+  >>> bud.address, bud.postal_code
+  ('513 Princess Ann Street', '22401')
+
+Any data not passed to the class are initialized to
+empty strings:
+
+  >>> bud = Buddy()
+  >>> bud.first, bud.last, bud.email
+  ('', '', '')
+  >>> bud.address, bud.postal_code
+  ('', '')
+
+You can get the full name of a buddy by calling its name
+method:
+
+  >>> bud = Buddy('Bob', 'Smith')
+  >>> bud.name()
+  'Bob Smith'

Modified: Zope3/trunk/src/buddydemo/tests.py
===================================================================
--- Zope3/trunk/src/buddydemo/tests.py	2004-08-30 13:59:05 UTC (rev 27353)
+++ Zope3/trunk/src/buddydemo/tests.py	2004-08-30 20:20:41 UTC (rev 27354)
@@ -1,5 +1,5 @@
 import unittest
-from doctest import DocTestSuite
+from zope.testing.doctest import DocFileSuite, DocTestSuite
 
 def test_BuddyInfo():
     """
@@ -94,6 +94,7 @@
 
 def test_suite():
     suite = unittest.TestSuite()
+    suite.addTest(DocFileSuite('buddy.txt'))
     suite.addTest(DocTestSuite('buddydemo.buddy'))
     suite.addTest(DocTestSuite('buddydemo.stubpostal'))
     suite.addTest(DocTestSuite())



More information about the Zope3-Checkins mailing list