def runImpl(idx, req): if idx == 9: return Nothing status = req(id, 2, 'json+list', utils.predefinedMove('json+list', idx).value) if status == 200: if req == post: runImpl(idx+2, next(req)) else: runImpl(idx, next(req)) else: runImpl(idx, req)
def runImpl(idx, req): if idx == 10: return Nothing status = req(params[0], params[1], params[3], utils.predefinedMove(params[3], idx).value) if status == 200: if req == post: runImpl(idx+2, next(req)) else: runImpl(idx, next(req)) else: runImpl(idx, req)
def test_predefined_moves(self): move = utils.predefinedMove('scala+list', 0) self.assertEqual(move, Just('List(Map(x -> 1, y -> 2, v -> x))')) self.assertEqual(utils.predefinedMove('not-existing-key', 0), Nothing)