예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
def test_lookup():
    lookup = main.lookup()
    assert len(lookup) > 0
    assert type(lookup) == dict
    assert type(lookup[0]) == str