def truncate_graph(self): script = "%s.V().map{it.get().remove()}" % str(MAPPER.gremlin.gv) MAPPER.query(script=script)
js = {} d = {} return (res, js, d) def post(path, data=None, headers=None): return req(method="POST", path=path, data=data, headers=headers) def put(path, data=None, headers=None): return req(method="PUT", path=path, data=data, headers=headers) try: gremlin = MAPPER.gremlin MAPPER.query(script="daily.V().map{it.get().remove()}") data = {'username': '******', 'password': '******', 'email': '*****@*****.**'} res = post('/register', data=data) login = post('/login', data={'email': data['email'], 'password': data['password']}) session = login[2].get('session_id') except Exception as e: import traceback # print(traceback.format_exc()) # traceback.print_stack(file=sys.stdout) # print('EXCEPTION!!!!!') # print(e)