]> granicus.if.org Git - python/commitdiff
A test case for the fix in #1674228.
authorGeorg Brandl <georg@python.org>
Tue, 6 Mar 2007 11:51:27 +0000 (11:51 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 6 Mar 2007 11:51:27 +0000 (11:51 +0000)
 (backport from rev. 54154)

Lib/test/test_slice.py

index d8eb88205c7102f984e018ec320fc18963e78d49..c34d9ea4ad393a7992d74d2a07a09668ae89f535 100644 (file)
@@ -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)