Debian Codegraph @

rpython/tool/test/test_frozenlist.py

raw symbols SCIP
1 import py
2 from rpython.tool.frozenlist import frozenlist
3
4 def test_frozenlist():
5 l = frozenlist([1, 2, 3])
6 assert l[0] == 1
7 assert l[:2] == [1, 2]
8 assert l.index(2) == 1
9 py.test.raises(TypeError, "l[0] = 1")
10 py.test.raises(TypeError, "del l[0]")
11 py.test.raises(TypeError, "l[:] = []")
12 py.test.raises(TypeError, "del l[:]")
13 py.test.raises(TypeError, "l += []")
14 py.test.raises(TypeError, "l *= 2")
15 py.test.raises(TypeError, "l.append(1)")
16 py.test.raises(TypeError, "l.insert(0, 0)")
17 py.test.raises(TypeError, "l.pop()")
18 py.test.raises(TypeError, "l.remove(1)")
19 py.test.raises(TypeError, "l.reverse()")
20 py.test.raises(TypeError, "l.sort()")
21 py.test.raises(TypeError, "l.extend([])")