MCPcopy
hub / github.com/pallets/werkzeug / test_proxy_list

Function test_proxy_list

tests/test_local.py:408–429  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

406
407
408def test_proxy_list():
409 _, p = _make_proxy([1, 2, 3])
410 assert len(p) == 3
411 assert p[0] == 1
412 assert 3 in p
413 assert 4 not in p
414 assert tuple(p) == (1, 2, 3)
415 assert list(reversed(p)) == [3, 2, 1]
416 p[0] = 4
417 assert p == [4, 2, 3]
418 del p[-1]
419 assert p == [4, 2]
420 p += [5]
421 assert p[-1] == 5
422 p *= 2
423 assert len(p) == 6
424 p[:] = []
425 assert not p
426 p.append(1)
427 assert p
428 assert p + [2] == [1, 2]
429 assert [2] + p == [2, 1]
430
431
432def test_proxy_copy():

Callers

nothing calls this directly

Calls 3

_make_proxyFunction · 0.85
appendMethod · 0.80
listFunction · 0.50

Tested by

no test coverage detected