MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / test_eval_pyobjects_cycle

Function test_eval_pyobjects_cycle

tests/python/test_objects.py:31–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29
30
31def test_eval_pyobjects_cycle():
32 class MyClass:
33 def __init__(self):
34 self.a = 1
35 self.b = 2
36 self.recursive = self
37
38 o = MyClass()
39
40 assert pm.eval("(obj) => { return obj.a; }")(o) == 1.0
41 assert pm.eval("(obj) => { return obj.b; }")(o) == 2.0
42 assert pm.eval("(obj) => { return obj.recursive; }")(o) is o.recursive
43
44
45def test_eval_pyobjects_proxy_get():

Callers

nothing calls this directly

Calls 1

MyClassClass · 0.85

Tested by

no test coverage detected