From: Georg Brandl Date: Tue, 6 Mar 2007 11:51:27 +0000 (+0000) Subject: A test case for the fix in #1674228. X-Git-Tag: v2.5.1c1~91 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0520e03d0fae6a25de8057eb63a4ca779e18fd14;p=python A test case for the fix in #1674228. (backport from rev. 54154) --- diff --git a/Lib/test/test_slice.py b/Lib/test/test_slice.py index d8eb88205c..c34d9ea4ad 100644 --- a/Lib/test/test_slice.py +++ b/Lib/test/test_slice.py @@ -92,6 +92,17 @@ class SliceTest(unittest.TestCase): self.assertRaises(OverflowError, slice(None).indices, 1L<<100) + def test_setslice_without_getslice(self): + tmp = [] + class X(object): + def __setslice__(self, i, j, k): + tmp.append((i, j, k)) + + x = X() + x[1:2] = 42 + self.assertEquals(tmp, [(1, 2, 42)]) + + def test_main(): test_support.run_unittest(SliceTest)