()
| 1685 | |
| 1686 | |
| 1687 | def test_some_self_pyfunction(): |
| 1688 | items = ['Four', 'Three', 'One'] |
| 1689 | |
| 1690 | def increment(self, element, index, array): |
| 1691 | self.count += 1 |
| 1692 | return False |
| 1693 | |
| 1694 | try: |
| 1695 | pm.eval(""" |
| 1696 | (arr, increment, result) => { |
| 1697 | let jsObj = {count: 0} |
| 1698 | arr.some(increment, jsObj); |
| 1699 | return jsObj.count; |
| 1700 | } |
| 1701 | """)(items, increment) |
| 1702 | assert False |
| 1703 | except Exception as e: |
| 1704 | assert type(e) is TypeError |
| 1705 | assert str(e).__contains__("unbound python functions do not have a 'self' to bind") |
| 1706 | |
| 1707 | |
| 1708 | def test_some_self_jsfunction(): |
nothing calls this directly
no outgoing calls
no test coverage detected