MCPcopy Index your code
hub / github.com/reactive-python/reactpy / test_basic_ref_behavior

Function test_basic_ref_behavior

src/py/reactpy/tests/test_utils.py:15–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13
14
15def test_basic_ref_behavior():
16 r = reactpy.Ref(1)
17 assert r.current == 1
18
19 r.current = 2
20 assert r.current == 2
21
22 assert r.set_current(3) == 2
23 assert r.current == 3
24
25 r = reactpy.Ref()
26 with pytest.raises(AttributeError):
27 r.current # noqa: B018
28
29 r.current = 4
30 assert r.current == 4
31
32
33def test_ref_equivalence():

Callers

nothing calls this directly

Calls 1

set_currentMethod · 0.95

Tested by

no test coverage detected