def testing_onebyone():
    datetime_now = str(datetime.datetime.now().strftime("DATE%Y-%m-%d_TIME%H-%M"))
    create_admin_tbl(datetime_now)
    log_dir = os.path.join(local_config_testing()['cur_path'],'testing_result',datetime_now)
    if os.path.isdir(log_dir) == False:
        os.system('mkdir -p %s'%(log_dir))
    logging.basicConfig(level=logging.DEBUG,
                    format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s',
                    datefmt='%a, %d %b %Y %H:%M:%S',
                    filename='%s/renderman.log'%(log_dir),
                    filemode='w')

    ex_wb = excel_writer(log_dir,datetime_now + '.xlsx')
    for test_case in local_config_testing()['test_case_list']:
        if test_case not in testing.TestingClassDict.keys():
            print '%s has not been completed...'%(test_case)
        else:
            print '%s has been completed...TIME:%s'%(test_case,datetime_now)
            test_obj = testing.TestingClassDict[test_case](logging,datetime_now)
            test_obj.run_testing()
            test_obj.create_tbl()
            test_obj.close_db()
            test_obj.get_fastest()
            test_obj.write_to_excel(ex_wb)
    ex_wb.save()
        work_book.set_cell(sheet_name,col,row,query)
        col += 1
        for cpufreq in des_dic[query].keys():
            des_dic[query][cpufreq].sort()
            if row == start_row:
                work_book.set_cell(sheet_name,col,row - 2,cpufreq)
            for i in range(local_config_testing()["every_query_times"]):
                if row == start_row:
                    work_book.set_cell(sheet_name,col,row - 1,'TIME_LINE')
                    work_book.set_cell(sheet_name,col+1,row - 1,'Remote_Start_Time')
                    work_book.set_cell(sheet_name,col+2,row - 1,'Query_Run_Time')
                    work_book.set_cell(sheet_name,col+3,row - 1,'Time_Stamp')
                if i >= len(des_dic[query][cpufreq]):
                    print("query:%s with cpu_freq(%s) has not been done,please retest it!"%(query,cpufreq))
                    break
                query_run_time,time_line,remote_start_time,time_stamp = des_dic[query][cpufreq][i]
                work_book.set_cell(sheet_name,col,row,time_line)
                col += 1
                work_book.set_cell(sheet_name,col,row,remote_start_time)
                col += 1
                work_book.set_cell(sheet_name,col,row,query_run_time)
                col += 1
                work_book.set_cell(sheet_name,col,row,time_stamp)
                col += 1
        row += 1
if __name__ == "__main__":
    ex_wb = excel_writer('temp_rendermanlog.xlsx')
    des_dic = analyze()
    write_to_excel(des_dic,ex_wb)
    ex_wb.save()