def test_10_run_job_mysql_text_local(self, class_home): #操作步骤:清楚目标文本内容,运行,下载目标文件,读取目标文件name,读取数据库表name,断言 Remote().cmd(dd.remote_ip, dd.remote_port, dd.remote_username, dd.remote_pwd, dd.delete_cmd) DesignerPage(class_home[0]).run_job_MySQL_text('local') Remote().get_file(dd.remote_ip, dd.remote_port, dd.remote_username, dd.remote_pwd, dd.remote_dir, dir_config.ftp_auto_text_01) mysql_name = DoMysql().select_table_1() assert DoFile().get_file_name() == mysql_name[0][1]
def test_9_run_job_distributed(self, class_home): #操作步骤:发布,运行,查询表1、2,对比表2与表1,清空表2内容 DoMysql().deletc_data() DesignerPage(class_home[0]).run_job('no_local') res = DoMysql().select_table_2() assert DoMysql().select_table_1() == res
def delete_table_ar_control_point(): DoMysql().delete_all_datas_from_table('ar_control_point')
# -*- coding: utf-8 -*- # @Time : 2019/6/5 11:07 # @Author : l7 # @Email :[email protected] # @File : do_text.py # @Software : PyCharm from numpy.compat import basestring from Common.do_mysql import DoMysql from Common import dir_config f = open(dir_config.ftp_auto_text_01, encoding='utf-8') lines = f.read() txt = lines print("txt取到的信息" + txt[2] + txt[3] + txt[4]) f.close() t1 = DoMysql().select_table_1() res = t1[0] print(t1[0][1]) print(res[1]) # print(txt[2]+txt[3]+txt[4]==res[1]) # ff=open("D:\YOYO\\auto_web_echo_v1\TestDatas\demo_1.txt","w+") # ff.truncate() # # ff.close()
def delete_table_ar_monitor_equipment(): DoMysql().delete_all_datas_from_table('ar_monitor_equipment')
def delete_table_sys_area(): DoMysql().delete_all_datas_from_table('sys_area')
def delete_table_ar_switch_cabinet(): DoMysql().delete_all_datas_from_table('ar_switch_cabinet')
def delete_table_ar_transformer(): DoMysql().delete_all_datas_from_table('ar_transformer')
def delete_table_ar_distribution_room(): DoMysql().delete_all_datas_from_table('ar_distribution_room')
def delete_table_sys_user(): # sql = 'DELETE FROM sys_user WHERE login_name <> "{}" and login_name <> "{}" and login_name <> "{}"'.format('thinkgem', 'idrmstest', 'idrmstest1') sql = 'DELETE FROM sys_user WHERE login_name <> "{}"'.format('thinkgem') DoMysql().delete_datas_from_table_with_sql(sql)
def test_8_run_job_local(self, class_home): #操作步骤:发布,运行,查询表1、2,对比表2与表1,清空表2内容 DoMysql().deletc_data(dd.sql_delete_t2) DesignerPage(class_home[0]).run_job('local') res = DoMysql().do_mysql(dd.select_table_2) assert DoMysql().do_mysql(dd.select_table_1) == res