def lookupdata(): if request.method == 'POST': id_node_joinded = int(request.form['NodeID']) data = int(request.form['data']) keyID = None print '----------------------------tien hanh lookup---------------------------' return main.lookup(id_node_joinded, keyID, data)
def lookupdata(): if request.method == 'POST': id_node_joinded = int(request.form['NodeID']) data = int(request.form['data']) keyID = None print '----------------------------tien hanh lookup---------------------------' cost = main.lookup(id_node_joinded, keyID, data) if cost == False: return "lookup khong thanh cong" else: return json.dumps({'chi phi: ': cost}, indent=3)
def test_lookup(): lookup = main.lookup() assert len(lookup) > 0 assert type(lookup) == dict assert type(lookup[0]) == str