Exemplo n.º 1
0
def authenticate():
    Settings.init()

    server = HTTPServer(('', 0), MapAuthHTTPServer)

    port = server.server_port

    print "%s/?port=%s" % (Settings.AUTH_ADDRESS, port)

    webbrowser.open("%s/?port=%s" %
        (Settings.AUTH_ADDRESS, port))

    print 'server started: http://localhost:' + str(port) + '/'
    while not Settings.COOKIES:
        server.handle_request()
Exemplo n.º 2
0


def delete_position(identifier):
    r = requests.delete(
        '%s/positions/%s' % (Settings.SERVER_ADDRESS, identifier),
        cookies=get_cookies())
    return r.text



if __name__ == '__main__':

    # Test suite

    Settings.init()

    print "USERS:"
    print get_users()
    User(username='******', alias='Julian Ceipek').put()
    print get_user('jceipek')
    delete_user('jceipek')
    print get_users()
    print

    print "PLACES:"
    print get_places()
    place = Place(name='Computer Lab', floor='MHLL', alias='Den of Theives')
    place.put()
    print get_place(place.id)
    delete_place(place.id)