def test_manager_alter(): url = "https://live-admin-qa1.youfenba.com/api/v1/manager/1099?" headers=test_headers() company = "test_测试公司", company_short="test_测试公司简称", logo=test_setup_function() remark='test备注', username='******' company = "".join(list(company)), company_short = "".join(list(company_short)), remark ="".join(list(remark)), url = url + 'company'+'='+"".join(list(company))+'&'+'company_short'+'='+"".join(list(company_short))+'&'+'logo'+"="+logo+'&'+'remark'+'='+"".join(list(remark))+'&'+'username'+'='+username print(url) # dict={ # "company":"11111", # "company_short":"22222", # "logo": test_setup_function(), # "remark":"test备注", # "username":"******" # } """图片未上传成功""" res = requests.put(url=url,headers=headers) r = res.json() assert r['company_short'] == company_short assert r['code'] == 200
def test_message_alter(): account_limit= "1" add_order= "1" buy_limit= "1" expired_at= "2021-04-30" is_vip= "1" order_type= "2" pay_price= "9900" pay_type= "alipay" price= "10000" type= "10" url1 = "https://live-admin-qa1.youfenba.com/api/v1/manager/1099?" url = url1 + 'account_limit'+'='+"".join(tuple(account_limit))+'&'+'add_order'+'='+"".join(tuple(add_order))+'&'+\ 'buy_limit'+"="+"".join(tuple(buy_limit))+'&'+'expired_at'+'='+"".join(tuple(expired_at))+'&'+\ 'is_vip'+'='+"".join(tuple(is_vip))+'&'+'order_type'+'='+"".join(tuple(order_type))+'&'+\ 'pay_price'+"="+"".join(tuple(pay_price))+'&'+'pay_type'+'='+"".join(tuple(pay_type))+\ '&'+'price'+'='+"".join(tuple(price))+'&'+'type'+'='+"".join(tuple(type)) headers = test_headers() res = requests.put(url=url,headers=headers) r = res.json() # cur = datetime.datetime.now() # io = str(cur) # time = io[0:10] sech_pay_price = data_sql.test_selectsingle(field="pay_price", table="vip_order", where="user_id" + "=" + "'" + "1099" + "'"+ 'and' +" " + "content" +"=" + "'"+ "后台生成订单" +"'" ) assert str(sech_pay_price[0]) == pay_price assert r['code'] == 200 del_order=data_sql.test_delete(table = "vip_order", field = "user_id" + "=" + "'" + "1099" + "'") print(r)
""" import json from itertools import count import pytest import allure import requests import yaml import os import requests import json """区间比较的库""" from interval import Interval from tools.gettoken import test_headers headers = test_headers() class Request: def request(self, url, method='get', **kwargs): if method == 'get': return requests.request(url=url, method=method, **kwargs) elif method == 'post': return requests.request(url=url, method=method, **kwargs) elif method == 'put': return requests.request(url=url, method=method, **kwargs) elif method == 'delete': return requests.request(url=url, method=method, **kwargs) def get(self, url, **kwargs): return self.request(url=url, method='get', **kwargs)