Example #1
0
 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)
Example #2
0
File: net.py Project: Haliucinas/FP
    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)
Example #3
0
	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)
Example #4
0
 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)