[Zodb-checkins] SVN: ZODB/trunk/src/BTrees/ Added the value class attribute to BTrees.Length.Length.
Albertas Agejevas
alga at pov.lt
Thu Feb 4 07:04:27 EST 2010
Log message for revision 108750:
Added the value class attribute to BTrees.Length.Length.
Fixes https://bugs.launchpad.net/zodb/+bug/516653 .
Changed:
U ZODB/trunk/src/BTrees/Length.py
U ZODB/trunk/src/BTrees/tests/testLength.py
-=-
Modified: ZODB/trunk/src/BTrees/Length.py
===================================================================
--- ZODB/trunk/src/BTrees/Length.py 2010-02-04 11:08:55 UTC (rev 108749)
+++ ZODB/trunk/src/BTrees/Length.py 2010-02-04 12:04:26 UTC (rev 108750)
@@ -30,6 +30,7 @@
instance-defined slot fillers are ignored.
"""
+ value = 0
def __init__(self, v=0):
self.value = v
Modified: ZODB/trunk/src/BTrees/tests/testLength.py
===================================================================
--- ZODB/trunk/src/BTrees/tests/testLength.py 2010-02-04 11:08:55 UTC (rev 108749)
+++ ZODB/trunk/src/BTrees/tests/testLength.py 2010-02-04 12:04:26 UTC (rev 108750)
@@ -18,6 +18,7 @@
__docformat__ = "reStructuredText"
import BTrees.Length
+import copy
import sys
import unittest
@@ -40,7 +41,13 @@
length.change(-1)
self.assertEqual(length(), minint - 1)
self.assert_(type(length()) is long)
-
+ def test_copy(self):
+ # Test for https://bugs.launchpad.net/zodb/+bug/516653
+ length = BTrees.Length.Length()
+ other = copy.copy(length)
+ self.assertEqual(other(), 0)
+
+
def test_suite():
return unittest.makeSuite(LengthTestCase)
More information about the Zodb-checkins
mailing list