mirror of https://github.com/python/cpython
parent
1d56c2ff6a
commit
0520e03d0f
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue