[Zope-Checkins] CVS: ZODB3/persistent/tests - test_PickleCache.py:1.1.2.1

Steve Alexander steve at cat-box.net
Wed Jan 28 12:25:35 EST 2004


Update of /cvs-repository/ZODB3/persistent/tests
In directory cvs.zope.org:/tmp/cvs-serv6829/tests

Added Files:
      Tag: zope3-zodb3-devel-branch
	test_PickleCache.py 
Log Message:
Fixed bug where error was not set when deleting an item from the cache.

Added a unit test that demonstrates the bug just fixed.



=== Added File ZODB3/persistent/tests/test_PickleCache.py ===
##############################################################################
#
# 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.
#
##############################################################################
"""Unit tests for PickleCache

$Id: test_PickleCache.py,v 1.1.2.1 2004/01/28 17:25:34 stevea Exp $
"""

class DummyConnection:

    def setklassstate(self, obj):
        """Method used by PickleCache."""


def test_delitem():
    """
    >>> from persistent import PickleCache
    >>> conn = DummyConnection()
    >>> cache = PickleCache(conn)
    >>> del cache['']
    Traceback (most recent call last):
    ...
    KeyError: ''

    """

from doctest import DocTestSuite
import unittest

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

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




More information about the Zope-Checkins mailing list