def set_path(): fp = os.path.abspath(sys.path[0]) if os.path.isfile(fp): fp = os.path.dirname(fp) path = os.path.join(fp, sc.PROJ_NAME).decode("cp936") tracer.set_proj_path(sc.PROJ_NAME, path, sysencoding = False)
******************************************************************** ====================================================================== UI and Web Http automation frame for python. ''' import sc import sys,os,types from pyrunner.executer import tracer def get_exe_path(proj_name): lib_path = os.path.abspath(sys.path[0]) return os.path.join(lib_path,proj_name).decode("cp936") tracer.set_proj_path(sc.PROJ_NAME, get_exe_path(sc.PROJ_NAME), sysencoding = False) from pyrunner.automation.datatrans import ExcelDpc,XmlDpc from pyrunner.executer import RunXlsxDpcData from pyrunner.common import p_env class DataDriverMap(ExcelDpc): ''' data = DataDriverMap('D:\\auto\\python\\app-autoDebug\\appDebugProject\\data\\tt.xlsx') testSet = data.getMapDataFeature() for (tid, test) in testSet.items(): print '\n', tid for (k, v) in test.items(): print '\t---%s:: %s' % (k, v) '''