You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
47 lines
1.3 KiB
|
1 week ago
|
#-*-coding:utf-8-*-
|
||
|
|
_author_ = 'Emily'
|
||
|
|
#@Time:2020/2/3 17:44
|
||
|
|
|
||
|
|
#影厅信息查询接口
|
||
|
|
import requests
|
||
|
|
import unittest
|
||
|
|
import pymysql
|
||
|
|
|
||
|
|
class getHallInfoInfer(unittest.TestCase):
|
||
|
|
def setUp(self):
|
||
|
|
self.get_url = 'http://192.168.55.99/?m=shows&a=getHallInfo'
|
||
|
|
|
||
|
|
# def test_right_getHallInfo(self):
|
||
|
|
# payload = ''
|
||
|
|
# rep = requests.post(self.get_url,data=payload)
|
||
|
|
# result=rep.json()
|
||
|
|
# print("打印影厅信息接口",result)
|
||
|
|
|
||
|
|
def test_wrong_innerCode(self):
|
||
|
|
db = pymysql.Connect("192.168.55.99", "dbadmin", "fXMSR37mLP7w88ji", "cine")
|
||
|
|
cursor = db.cursor()
|
||
|
|
sql = "UPDATE `cinema_set` SET cinema_inner_code = '0'"
|
||
|
|
try:
|
||
|
|
cursor.execute(sql)
|
||
|
|
db.commit()
|
||
|
|
except:
|
||
|
|
db.rollback()
|
||
|
|
#ticket_qrcode.close()
|
||
|
|
|
||
|
|
payload=''
|
||
|
|
rep = requests.post(self.get_url,data=payload)
|
||
|
|
resultWront = rep.json()
|
||
|
|
print("打印错误内码影厅信息",resultWront)
|
||
|
|
|
||
|
|
sql1 = "UPDATE `cinema_set` SET cinema_inner_code = '304'"
|
||
|
|
cursor.execute(sql1)
|
||
|
|
db.commit()
|
||
|
|
sql2 = "select * from cinema_set"
|
||
|
|
cursor.execute(sql2)
|
||
|
|
result = cursor.fetchall()
|
||
|
|
print("打印表数据",result)
|
||
|
|
def tearDown(self):
|
||
|
|
pass
|
||
|
|
|
||
|
|
if __name__ == '__main__':
|
||
|
|
unittest.main()
|