Commit 5e3a1f9d authored by Tim Peters's avatar Tim Peters

New test testBadUpdateTupleSize(). This dumps core in Zope3; Zope2 is

fine; just keeping the test suite as closely in synch as possible.
parent e7997255
......@@ -335,6 +335,27 @@ class MappingBase(Base):
self.assertEqual(len(tslice), 60)
self.assertEqual(list(tslice), zip(range(20, 80), [1]*60))
def testBadUpdateTupleSize(self):
# This one silently ignored the excess in Zope3.
try:
self.t.update([(1, 2, 3)])
except TypeError:
pass
else:
self.fail("update() with 3-tuple didn't complain")
# This one dumped core in Zope3.
try:
self.t.update([(1,)])
except TypeError:
pass
else:
self.fail("update() with 1-tuple didn't complain")
# This one should simply succeed.
self.t.update([(1, 2)])
self.assertEqual(list(self.t.items()), [(1, 2)])
class NormalSetTests(Base):
""" Test common to all set types """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment