Revision: 8231
http://svn.sourceforge.net/mailman/?rev=8231&view=rev
Author: bwarsaw
Date: 2007-06-01 19:06:53 -0700 (Fri, 01 Jun 2007)
Log Message:
-----------
rename a few tests
Added Paths:
-----------
trunk/mailman/Mailman/docs/listmanager.txt
trunk/mailman/Mailman/docs/usermanager.txt
trunk/mailman/Mailman/testing/test_listmanager.py
trunk/mailman/Mailman/testing/test_usermanager.py
Removed Paths:
-------------
trunk/mailman/Mailman/docs/use-listmanager.txt
trunk/mailman/Mailman/docs/use-usermanager.txt
trunk/mailman/Mailman/testing/test_use_listmanager.py
trunk/mailman/Mailman/testing/test_use_usermanager.py
Copied: trunk/mailman/Mailman/docs/listmanager.txt (from rev 8230,
trunk/mailman/Mailman/docs/use-listmanager.txt)
===================================================================
--- trunk/mailman/Mailman/docs/listmanager.txt (rev 0)
+++ trunk/mailman/Mailman/docs/listmanager.txt 2007-06-02 02:06:53 UTC (rev
8231)
@@ -0,0 +1,124 @@
+Using the IListManager interface
+================================
+
+The IListManager is how you create, delete, and retrieve mailing list
+objects. The Mailman system instantiates an IListManager for you based on the
+configuration variable MANAGERS_INIT_FUNCTION. The instance is accessible
+on the global config object.
+
+ >>> from Mailman.database import flush
+ >>> from Mailman.configuration import config
+ >>> from Mailman.interfaces import IListManager
+ >>> IListManager.providedBy(config.list_manager)
+ True
+ >>> mgr = config.list_manager
+
+
+Creating a mailing list
+-----------------------
+
+Creating the list returns the newly created IMailList object.
+
+ >>> from Mailman.interfaces import IMailingList
+ >>> mlist = mgr.create('[EMAIL PROTECTED]')
+ >>> flush()
+ >>> IMailingList.providedBy(mlist)
+ True
+
+This object has an identity.
+
+ >>> from Mailman.interfaces import IMailingListIdentity
+ >>> IMailingListIdentity.providedBy(mlist)
+ True
+
+All lists with identities have a short name, a host name, and a fully
+qualified listname. This latter is what uniquely distinguishes the mailing
+list to the system.
+
+ >>> mlist.list_name
+ '_xtest'
+ >>> mlist.host_name
+ 'example.com'
+ >>> mlist.fqdn_listname
+ '[EMAIL PROTECTED]'
+
+If you try to create a mailing list with the same name as an existing list,
+you will get an exception.
+
+ >>> mlist_dup = mgr.create('[EMAIL PROTECTED]')
+ Traceback (most recent call last):
+ ...
+ MMListAlreadyExistsError: [EMAIL PROTECTED]
+
+
+Deleting a mailing list
+-----------------------
+
+Deleting an existing mailing list also deletes its rosters and roster sets.
+
+ >>> sorted(r.name for r in config.user_manager.rosters)
+ ['', '[EMAIL PROTECTED] moderators', '[EMAIL PROTECTED] owners']
+
+ >>> mgr.delete(mlist)
+ >>> flush()
+ >>> sorted(mgr.names)
+ []
+ >>> sorted(r.name for r in config.user_manager.rosters)
+ ['']
+
+Attempting to access attributes of the deleted mailing list raises an
+exception:
+
+ >>> mlist.fqdn_listname
+ Traceback (most recent call last):
+ ...
+ AttributeError: fqdn_listname
+
+After deleting the list, you can create it again.
+
+ >>> mlist = mgr.create('[EMAIL PROTECTED]')
+ >>> flush()
+ >>> mlist.fqdn_listname
+ '[EMAIL PROTECTED]'
+
+
+Retrieving a mailing list
+-------------------------
+
+When a mailing list exists, you can ask the list manager for it and you will
+always get the same object back.
+
+ >>> mlist_2 = mgr.get('[EMAIL PROTECTED]')
+ >>> mlist_2 is mlist
+ True
+
+Don't try to get a list that doesn't exist yet though, or you will get an
+exception.
+
+ >>> mgr.get('[EMAIL PROTECTED]')
+ Traceback (most recent call last):
+ ...
+ MMUnknownListError: [EMAIL PROTECTED]
+
+
+Iterating over all mailing lists
+--------------------------------
+
+Once you've created a bunch of mailing lists, you can use the list manager to
+iterate over either the list objects, or the list names.
+
+ >>> mlist_3 = mgr.create('[EMAIL PROTECTED]')
+ >>> mlist_4 = mgr.create('[EMAIL PROTECTED]')
+ >>> flush()
+ >>> sorted(mgr.names)
+ ['[EMAIL PROTECTED]', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]']
+ >>> sorted(m.fqdn_listname for m in mgr.mailing_lists)
+ ['[EMAIL PROTECTED]', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]']
+
+
+Cleaning up
+-----------
+
+ >>> for mlist in mgr.mailing_lists:
+ ... mgr.delete(mlist)
+ >>> flush()
Deleted: trunk/mailman/Mailman/docs/use-listmanager.txt
===================================================================
--- trunk/mailman/Mailman/docs/use-listmanager.txt 2007-05-31 05:01:00 UTC
(rev 8230)
+++ trunk/mailman/Mailman/docs/use-listmanager.txt 2007-06-02 02:06:53 UTC
(rev 8231)
@@ -1,124 +0,0 @@
-Using the IListManager interface
-================================
-
-The IListManager is how you create, delete, and retrieve mailing list
-objects. The Mailman system instantiates an IListManager for you based on the
-configuration variable MANAGERS_INIT_FUNCTION. The instance is accessible
-on the global config object.
-
- >>> from Mailman.database import flush
- >>> from Mailman.configuration import config
- >>> from Mailman.interfaces import IListManager
- >>> IListManager.providedBy(config.list_manager)
- True
- >>> mgr = config.list_manager
-
-
-Creating a mailing list
------------------------
-
-Creating the list returns the newly created IMailList object.
-
- >>> from Mailman.interfaces import IMailingList
- >>> mlist = mgr.create('[EMAIL PROTECTED]')
- >>> flush()
- >>> IMailingList.providedBy(mlist)
- True
-
-This object has an identity.
-
- >>> from Mailman.interfaces import IMailingListIdentity
- >>> IMailingListIdentity.providedBy(mlist)
- True
-
-All lists with identities have a short name, a host name, and a fully
-qualified listname. This latter is what uniquely distinguishes the mailing
-list to the system.
-
- >>> mlist.list_name
- '_xtest'
- >>> mlist.host_name
- 'example.com'
- >>> mlist.fqdn_listname
- '[EMAIL PROTECTED]'
-
-If you try to create a mailing list with the same name as an existing list,
-you will get an exception.
-
- >>> mlist_dup = mgr.create('[EMAIL PROTECTED]')
- Traceback (most recent call last):
- ...
- MMListAlreadyExistsError: [EMAIL PROTECTED]
-
-
-Deleting a mailing list
------------------------
-
-Deleting an existing mailing list also deletes its rosters and roster sets.
-
- >>> sorted(r.name for r in config.user_manager.rosters)
- ['', '[EMAIL PROTECTED] moderators', '[EMAIL PROTECTED] owners']
-
- >>> mgr.delete(mlist)
- >>> flush()
- >>> sorted(mgr.names)
- []
- >>> sorted(r.name for r in config.user_manager.rosters)
- ['']
-
-Attempting to access attributes of the deleted mailing list raises an
-exception:
-
- >>> mlist.fqdn_listname
- Traceback (most recent call last):
- ...
- AttributeError: fqdn_listname
-
-After deleting the list, you can create it again.
-
- >>> mlist = mgr.create('[EMAIL PROTECTED]')
- >>> flush()
- >>> mlist.fqdn_listname
- '[EMAIL PROTECTED]'
-
-
-Retrieving a mailing list
--------------------------
-
-When a mailing list exists, you can ask the list manager for it and you will
-always get the same object back.
-
- >>> mlist_2 = mgr.get('[EMAIL PROTECTED]')
- >>> mlist_2 is mlist
- True
-
-Don't try to get a list that doesn't exist yet though, or you will get an
-exception.
-
- >>> mgr.get('[EMAIL PROTECTED]')
- Traceback (most recent call last):
- ...
- MMUnknownListError: [EMAIL PROTECTED]
-
-
-Iterating over all mailing lists
---------------------------------
-
-Once you've created a bunch of mailing lists, you can use the list manager to
-iterate over either the list objects, or the list names.
-
- >>> mlist_3 = mgr.create('[EMAIL PROTECTED]')
- >>> mlist_4 = mgr.create('[EMAIL PROTECTED]')
- >>> flush()
- >>> sorted(mgr.names)
- ['[EMAIL PROTECTED]', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]']
- >>> sorted(m.fqdn_listname for m in mgr.mailing_lists)
- ['[EMAIL PROTECTED]', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]']
-
-
-Cleaning up
------------
-
- >>> for mlist in mgr.mailing_lists:
- ... mgr.delete(mlist)
- >>> flush()
Deleted: trunk/mailman/Mailman/docs/use-usermanager.txt
===================================================================
--- trunk/mailman/Mailman/docs/use-usermanager.txt 2007-05-31 05:01:00 UTC
(rev 8230)
+++ trunk/mailman/Mailman/docs/use-usermanager.txt 2007-06-02 02:06:53 UTC
(rev 8231)
@@ -1,100 +0,0 @@
-The user manager and rosters
-============================
-
-The IUserManager is how you create, delete, and roster objects. Rosters
-manage collections of users. The Mailman system instantiates an IUserManager
-for you based on the configuration variable MANAGERS_INIT_FUNCTION. The
-instance is accessible on the global config object.
-
- >>> from Mailman.configuration import config
- >>> from Mailman.interfaces import IUserManager
- >>> mgr = config.user_manager
- >>> IUserManager.providedBy(mgr)
- True
-
-
-The default roster
-------------------
-
-The user manager always contains at least one roster, the 'null' roster or
-'all inclusive roster'.
-
- >>> sorted(roster.name for roster in mgr.rosters)
- ['']
-
-
-Adding rosters
---------------
-
-You create a roster to hold users. The only thing a roster needs is a name,
-basically just an identifying string.
-
- >>> from Mailman.database import flush
- >>> from Mailman.interfaces import IRoster
- >>> roster = mgr.create_roster('roster-1')
- >>> IRoster.providedBy(roster)
- True
- >>> roster.name
- 'roster-1'
- >>> flush()
-
-If you try to create a roster with the same name as an existing roster, you
-will get an exception.
-
- >>> roster_dup = mgr.create_roster('roster-1')
- Traceback (most recent call last):
- ...
- RosterExistsError: roster-1
-
-
-Deleting a roster
------------------
-
-Delete the roster, and you can then create it again.
-
- >>> mgr.delete_roster(roster)
- >>> flush()
- >>> roster = mgr.create_roster('roster-1')
- >>> flush()
- >>> roster.name
- 'roster-1'
-
-
-Retrieving a roster
--------------------
-
-When a roster exists, you can ask the user manager for it and you will always
-get the same object back.
-
- >>> roster_2 = mgr.get_roster('roster-1')
- >>> roster_2.name
- 'roster-1'
- >>> roster is roster_2
- True
-
-Trying to get a roster that does not yet exist returns None.
-
- >>> print mgr.get_roster('no roster')
- None
-
-
-Iterating over all the rosters
-------------------------------
-
-Once you've created a bunch of rosters, you can use the user manager to
-iterate over all the rosters.
-
- >>> roster_2 = mgr.create_roster('roster-2')
- >>> roster_3 = mgr.create_roster('roster-3')
- >>> roster_4 = mgr.create_roster('roster-4')
- >>> flush()
- >>> sorted(roster.name for roster in mgr.rosters)
- ['', 'roster-1', 'roster-2', 'roster-3', 'roster-4']
-
-
-Cleaning up
------------
-
- >>> for roster in mgr.rosters:
- ... mgr.delete_roster(roster)
- >>> flush()
Copied: trunk/mailman/Mailman/docs/usermanager.txt (from rev 8230,
trunk/mailman/Mailman/docs/use-usermanager.txt)
===================================================================
--- trunk/mailman/Mailman/docs/usermanager.txt (rev 0)
+++ trunk/mailman/Mailman/docs/usermanager.txt 2007-06-02 02:06:53 UTC (rev
8231)
@@ -0,0 +1,100 @@
+The user manager and rosters
+============================
+
+The IUserManager is how you create, delete, and roster objects. Rosters
+manage collections of users. The Mailman system instantiates an IUserManager
+for you based on the configuration variable MANAGERS_INIT_FUNCTION. The
+instance is accessible on the global config object.
+
+ >>> from Mailman.configuration import config
+ >>> from Mailman.interfaces import IUserManager
+ >>> mgr = config.user_manager
+ >>> IUserManager.providedBy(mgr)
+ True
+
+
+The default roster
+------------------
+
+The user manager always contains at least one roster, the 'null' roster or
+'all inclusive roster'.
+
+ >>> sorted(roster.name for roster in mgr.rosters)
+ ['']
+
+
+Adding rosters
+--------------
+
+You create a roster to hold users. The only thing a roster needs is a name,
+basically just an identifying string.
+
+ >>> from Mailman.database import flush
+ >>> from Mailman.interfaces import IRoster
+ >>> roster = mgr.create_roster('roster-1')
+ >>> IRoster.providedBy(roster)
+ True
+ >>> roster.name
+ 'roster-1'
+ >>> flush()
+
+If you try to create a roster with the same name as an existing roster, you
+will get an exception.
+
+ >>> roster_dup = mgr.create_roster('roster-1')
+ Traceback (most recent call last):
+ ...
+ RosterExistsError: roster-1
+
+
+Deleting a roster
+-----------------
+
+Delete the roster, and you can then create it again.
+
+ >>> mgr.delete_roster(roster)
+ >>> flush()
+ >>> roster = mgr.create_roster('roster-1')
+ >>> flush()
+ >>> roster.name
+ 'roster-1'
+
+
+Retrieving a roster
+-------------------
+
+When a roster exists, you can ask the user manager for it and you will always
+get the same object back.
+
+ >>> roster_2 = mgr.get_roster('roster-1')
+ >>> roster_2.name
+ 'roster-1'
+ >>> roster is roster_2
+ True
+
+Trying to get a roster that does not yet exist returns None.
+
+ >>> print mgr.get_roster('no roster')
+ None
+
+
+Iterating over all the rosters
+------------------------------
+
+Once you've created a bunch of rosters, you can use the user manager to
+iterate over all the rosters.
+
+ >>> roster_2 = mgr.create_roster('roster-2')
+ >>> roster_3 = mgr.create_roster('roster-3')
+ >>> roster_4 = mgr.create_roster('roster-4')
+ >>> flush()
+ >>> sorted(roster.name for roster in mgr.rosters)
+ ['', 'roster-1', 'roster-2', 'roster-3', 'roster-4']
+
+
+Cleaning up
+-----------
+
+ >>> for roster in mgr.rosters:
+ ... mgr.delete_roster(roster)
+ >>> flush()
Copied: trunk/mailman/Mailman/testing/test_listmanager.py (from rev 8230,
trunk/mailman/Mailman/testing/test_use_listmanager.py)
===================================================================
--- trunk/mailman/Mailman/testing/test_listmanager.py
(rev 0)
+++ trunk/mailman/Mailman/testing/test_listmanager.py 2007-06-02 02:06:53 UTC
(rev 8231)
@@ -0,0 +1,28 @@
+# Copyright (C) 2007 by the Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+"""Doctest harness for testing mailing list creation and deletion."""
+
+import doctest
+import unittest
+
+
+def test_suite():
+ suite = unittest.TestSuite()
+ suite.addTest(doctest.DocFileSuite('../docs/listmanager.txt',
+ optionflags=doctest.ELLIPSIS))
+ return suite
Deleted: trunk/mailman/Mailman/testing/test_use_listmanager.py
===================================================================
--- trunk/mailman/Mailman/testing/test_use_listmanager.py 2007-05-31
05:01:00 UTC (rev 8230)
+++ trunk/mailman/Mailman/testing/test_use_listmanager.py 2007-06-02
02:06:53 UTC (rev 8231)
@@ -1,28 +0,0 @@
-# Copyright (C) 2007 by the Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-# USA.
-
-"""Doctest harness for testing mailing list creation and deletion."""
-
-import doctest
-import unittest
-
-
-def test_suite():
- suite = unittest.TestSuite()
- suite.addTest(doctest.DocFileSuite('../docs/use-listmanager.txt',
- optionflags=doctest.ELLIPSIS))
- return suite
Deleted: trunk/mailman/Mailman/testing/test_use_usermanager.py
===================================================================
--- trunk/mailman/Mailman/testing/test_use_usermanager.py 2007-05-31
05:01:00 UTC (rev 8230)
+++ trunk/mailman/Mailman/testing/test_use_usermanager.py 2007-06-02
02:06:53 UTC (rev 8231)
@@ -1,28 +0,0 @@
-# Copyright (C) 2007 by the Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-# USA.
-
-"""Doctest harness for testing mailing list creation and deletion."""
-
-import doctest
-import unittest
-
-
-def test_suite():
- suite = unittest.TestSuite()
- suite.addTest(doctest.DocFileSuite('../docs/use-usermanager.txt',
- optionflags=doctest.ELLIPSIS))
- return suite
Copied: trunk/mailman/Mailman/testing/test_usermanager.py (from rev 8230,
trunk/mailman/Mailman/testing/test_use_usermanager.py)
===================================================================
--- trunk/mailman/Mailman/testing/test_usermanager.py
(rev 0)
+++ trunk/mailman/Mailman/testing/test_usermanager.py 2007-06-02 02:06:53 UTC
(rev 8231)
@@ -0,0 +1,28 @@
+# Copyright (C) 2007 by the Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+"""Doctest harness for testing mailing list creation and deletion."""
+
+import doctest
+import unittest
+
+
+def test_suite():
+ suite = unittest.TestSuite()
+ suite.addTest(doctest.DocFileSuite('../docs/usermanager.txt',
+ optionflags=doctest.ELLIPSIS))
+ return suite
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org