[Zope3-checkins] CVS: Zope3/src/datetime/tests - test_datetime.py:1.29
Tim Peters
tim.one@comcast.net
Fri, 31 Jan 2003 22:24:47 -0500
Update of /cvs-repository/Zope3/src/datetime/tests
In directory cvs.zope.org:/tmp/cvs-serv26959/src/datetime/tests
Modified Files:
test_datetime.py
Log Message:
__getstate__() isn't needed for pickling anymore, but is used for other
things (like hashing and comparison), so make them private methods. This
was done earlier for __setstate__() too.
Note that the use of getstate() to get state strings for comparisons (and
such) makes good *sense* only in the 2.3 C implementation, where the
internal object memory *is* a little state string. We're doing this in
the Python implementation too primarily to make sure it always delivers
the same results as the C implementation.
=== Zope3/src/datetime/tests/test_datetime.py 1.28 => 1.29 ===
--- Zope3/src/datetime/tests/test_datetime.py:1.28 Fri Jan 31 17:01:05 2003
+++ Zope3/src/datetime/tests/test_datetime.py Fri Jan 31 22:24:44 2003
@@ -276,8 +276,6 @@
def test_pickling(self):
args = 12, 34, 56
orig = timedelta(*args)
- state = orig.__getstate__()
- self.assertEqual(args, state)
for pickler, unpickler, proto in pickle_choices:
green = pickler.dumps(orig, proto)
derived = unpickler.loads(green)
@@ -830,8 +828,6 @@
def test_pickling(self):
args = 6, 7, 23
orig = self.theclass(*args)
- state = orig.__getstate__()
- self.assertEqual(state, ('\x00\x06\x07\x17',), self.theclass)
for pickler, unpickler, proto in pickle_choices:
green = pickler.dumps(orig, proto)
derived = unpickler.loads(green)
@@ -1184,8 +1180,6 @@
def test_pickling(self):
args = 6, 7, 23, 20, 59, 1, 64**2
orig = self.theclass(*args)
- state = orig.__getstate__()
- self.assertEqual(state, ('\x00\x06\x07\x17\x14\x3b\x01\x00\x10\x00',))
for pickler, unpickler, proto in pickle_choices:
green = pickler.dumps(orig, proto)
derived = unpickler.loads(green)
@@ -1565,8 +1559,6 @@
def test_pickling(self):
args = 20, 59, 16, 64**2
orig = self.theclass(*args)
- state = orig.__getstate__()
- self.assertEqual(state, ('\x14\x3b\x10\x00\x10\x00',))
for pickler, unpickler, proto in pickle_choices:
green = pickler.dumps(orig, proto)
derived = unpickler.loads(green)
@@ -1875,8 +1867,6 @@
# Try one without a tzinfo.
args = 20, 59, 16, 64**2
orig = self.theclass(*args)
- state = orig.__getstate__()
- self.assertEqual(state, ('\x14\x3b\x10\x00\x10\x00',))
for pickler, unpickler, proto in pickle_choices:
green = pickler.dumps(orig, proto)
derived = unpickler.loads(green)
@@ -2078,8 +2068,6 @@
# Try one without a tzinfo.
args = 6, 7, 23, 20, 59, 1, 64**2
orig = self.theclass(*args)
- state = orig.__getstate__()
- self.assertEqual(state, ('\x00\x06\x07\x17\x14\x3b\x01\x00\x10\x00',))
for pickler, unpickler, proto in pickle_choices:
green = pickler.dumps(orig, proto)
derived = unpickler.loads(green)