()
| 1225 | |
| 1226 | |
| 1227 | def test_map_self_pyfunction(): |
| 1228 | items = ['Four', 'Three', 'One'] |
| 1229 | |
| 1230 | def increment(self, element, index, array): |
| 1231 | self.count += 1 |
| 1232 | |
| 1233 | try: |
| 1234 | pm.eval(""" |
| 1235 | (arr, increment, result) => { |
| 1236 | let jsObj = {count: 0} |
| 1237 | arr.map(increment, jsObj); |
| 1238 | return jsObj.count; |
| 1239 | } |
| 1240 | """)(items, increment) |
| 1241 | assert False |
| 1242 | except Exception as e: |
| 1243 | assert type(e) is TypeError |
| 1244 | assert str(e).__contains__("unbound python functions do not have a 'self' to bind") |
| 1245 | |
| 1246 | |
| 1247 | def test_map_self_jsfunction(): |
nothing calls this directly
no outgoing calls
no test coverage detected