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

Function test_every_self_pyfunction

tests/python/test_arrays.py:1817–1834  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1815
1816
1817def test_every_self_pyfunction():
1818 items = ['Four', 'Three', 'One']
1819
1820 def increment(self, element, index, array):
1821 self.count += 1
1822
1823 try:
1824 pm.eval("""
1825 (arr, increment, result) => {
1826 let jsObj = {count: 0}
1827 arr.every(increment, jsObj);
1828 return jsObj.count;
1829 }
1830 """)(items, increment)
1831 assert False
1832 except Exception as e:
1833 assert type(e) is TypeError
1834 assert str(e).__contains__("unbound python functions do not have a 'self' to bind")
1835
1836
1837def test_every_self_jsfunction():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected