# -*- encoding: utf-8 -*- ''' Current module: run Rough version history: v1.0 Original version to use ******************************************************************** @AUTHOR: Administrator-Bruce Luo(罗科峰) MAIL: [email protected] RCS: run,v 1.0 2015年11月19日 FROM: 2015年11月19日 ******************************************************************** ====================================================================== Flask frame for automation test with python. APIS: / /index /pyrunner/data/manager/<table>/<table_field>/<table_id> table: ["test_case","test_des_step","test_step","collection","case_collection","run"] method: GET POST PUT DELETE ''' from pyrunnerwbs import APP APP.run(debug=True)
if action == "rockadd": return add_func(table) if action == "rockdel": return del_func(table) if action == "rockupd": return upd_func(table,request.form) if action == "rocksel": upd_id = request.args.get("upd_id") reqform = request.form if upd_id: reqform = reqform.to_dict() reqform[wbs_common.TABLES_MAP_PREMARY[table]]=upd_id return sel_func(table,reqform,raw=True) return sel_func(table,reqform) def __assembleSqlFromList(sql_lst): sql="" for i in sql_lst: if isinstance(i, list): sql = sql + " " +str(tuple(i)) continue sql = sql + " " + i return sql if __name__ == "__main__": with APP.test_request_context(): print request