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

Function test_proxy_local

tests/test_local.py:136–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134
135
136def test_proxy_local():
137 ns = local.Local(_cv_ns)
138 ns.foo = []
139 p = local.LocalProxy(ns, "foo")
140 p.append(42)
141 p.append(23)
142 p[1:] = [1, 2, 3]
143 assert p == [42, 1, 2, 3]
144 assert p == ns.foo
145 ns.foo += [1]
146 assert list(p) == [42, 1, 2, 3, 1]
147 p_from_local = ns("foo")
148 p_from_local.append(2)
149 assert p == p_from_local
150 assert p._get_current_object() is ns.foo
151
152
153def test_proxy_callable():

Callers

nothing calls this directly

Calls 3

_get_current_objectMethod · 0.95
appendMethod · 0.80
listFunction · 0.50

Tested by

no test coverage detected