Skip to content

Commit

Permalink
Use newer doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Fulton committed Apr 1, 2005
0 parents commit 639bd84
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Multi-mapping tests
>>> from MultiMapping import *
>>> def sortprint(L):
... L.sort()
... print L
>>> m=MultiMapping()
>>> m.push({'spam':1, 'eggs':2})
>>> print m['spam']
1
>>> print m['eggs']
2
>>> m.push({'spam':3})
>>> print m['spam']
3
>>> print m['eggs']
2
>>> sortprint(m.pop().items())
[('spam', 3)]
>>> sortprint(m.pop().items())
[('eggs', 2), ('spam', 1)]
>>> try:
... print m.pop()
... raise "That\'s odd", "This last pop should have failed!"
... except: # I should probably raise a specific error in this case.
... pass
$Id$
"""
import unittest
from zope.testing.doctest import DocTestSuite

def test_suite():
return unittest.TestSuite((
DocTestSuite(),
))

if __name__ == '__main__': unittest.main()

0 comments on commit 639bd84

Please sign in to comment.