def get_sql_expect_data(self, row, col=None): # '''根据header确认数据库配置''' #''' 根据传入的列以确定数据读取、写入的位置''' if col is None: col = int(data_config.get_expect()) else: col = col sql = self.opera_excle.get_cell_value(row, col) self.sql = sql if sql: header_flag = self.getHeaderType(row) if header_flag == self.crm_headerFlag: # CRM header try: sql_except = self.tencent_cloud.sql_operation_limit(sql) except TypeError as error: sql_except = None self.log.error(self.mylog.out_varname(error)) elif header_flag==self.fwh_headerFlag or \ header_flag==self.fwh_admin_headerFlag: # 服务号 、服务号后台sql配置 try: sql_except = self.tencent_cloud.sql_operation_limit(sql) except TypeError as error: sql_except = None self.log.error(self.mylog.out_varname(error)) else: try: sql_except = self.tencent_cloud.sql_operation_limit(sql) except TypeError as error: sql_except = None self.log.error(self.mylog.out_varname(error)) return sql_except else: return False
def get_expect_data(self,row): col=int(data_config.get_expect()) expect=self.opera_excle.get_cell_value(row,col) # if expect=='': # return None return expect
def get_sql_expect_data(self,row): sql=int(data_config.get_expect(row)) My_op=Mysql_operation() sql_except=My_op.sql_select(sql)[0] return sql_except
def get_expect_data(self, row): col = int(data_config.get_expect()) expect = self.opera_excle.get_cell_value(row, col) # ''' 替换双引号为单引号,避免由于引号问题出现断言失败''' return expect