Commit b68e7d55dc5ad30a9e1262deeb12e8ef9eeb5c58
Merge remote-tracking branch 'origin/master' into master
Showing
4 changed files
with
100 additions
and
87 deletions
config/api/upStream.conf deleted
100644 → 0
1 | -# -*- coding: UTF-8 -*- | |
2 | -[upStream] | |
3 | -method=post | |
4 | -url=http://test.trace.diligrp.com:8393/upStream/listPage.action | |
5 | -body_format=JSON | |
6 | -header={ | |
7 | - "Host": "test.trace.diligrp.com", | |
8 | - "Connection": "keep-alive", | |
9 | - "Content-Length": "325", | |
10 | - "Accept": "application/json,text/javascript,*/*;q=0.01", | |
11 | - "X-Requested-With": "XMLHttpRequest", | |
12 | - "User-Agent": "Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/90.0.4430.212Safari/537.36", | |
13 | - "Content-Type": "application/json", | |
14 | - "Origin": "http://test.trace.diligrp.com:8393", | |
15 | - "Referer": "http://test.trace.diligrp.com:8393/upStream/index.html", | |
16 | - "Accept-Encoding": "gzip,deflate", | |
17 | - "Accept-Language": "zh-CN,zh-TW;q=0.9,zh;q=0.8,en;q=0.7"} | |
18 | - | |
19 | -[upStream01] | |
20 | -body={"rows":10,"page":1,"sort":"id","order":"desc","metadata":{"created":"{\"provider\":\"datetimeProvider\",\"index\":10,\"field\":\"created\"}","upORdown":"{\"provider\":\"userFlagProvider\",\"index\":20,\"field\":\"upORdown\"}","upstreamType":"{\"provider\":\"upStreamTypeProvider\",\"index\":30,\"field\":\"upstreamType\"}"}} | |
21 | - | |
22 | - | |
23 | -[upStream02] | |
24 | -body={"rows":10,"page":1,"sort":"id","order":"desc","metadata":{"created":"{\"provider\":\"datetimeProvider\",\"index\":10,\"field\":\"created\"}","upORdown":"{\"provider\":\"userFlagProvider\",\"index\":20,\"field\":\"upORdown\"}","upstreamType":"{\"provider\":\"upStreamTypeProvider\",\"index\":30,\"field\":\"upstreamType\"}"}} | |
25 | - | |
26 | - | |
27 | -[upStream03] | |
28 | -body={"rows":10,"page":1,"sort":"id","order":"desc","metadata":{"created":"{\"provider\":\"datetimeProvider\",\"index\":10,\"field\":\"created\"}","upORdown":"{\"provider\":\"userFlagProvider\",\"index\":20,\"field\":\"upORdown\"}","upstreamType":"{\"provider\":\"upStreamTypeProvider\",\"index\":30,\"field\":\"upstreamType\"}"}} | |
29 | - | |
30 | - | |
31 | -[upStream04] | |
32 | -body={"rows":10,"page":1,"sort":"id","order":"desc","metadata":{"created":"{\"provider\":\"datetimeProvider\",\"index\":10,\"field\":\"created\"}","upORdown":"{\"provider\":\"userFlagProvider\",\"index\":20,\"field\":\"upORdown\"}","upstreamType":"{\"provider\":\"upStreamTypeProvider\",\"index\":30,\"field\":\"upstreamType\"}"}} | |
33 | - | |
34 | - | |
35 | -[upStream05] | |
36 | -body={"rows":10,"page":1,"sort":"id","order":"desc","metadata":{"created":"{\"provider\":\"datetimeProvider\",\"index\":10,\"field\":\"created\"}","upORdown":"{\"provider\":\"userFlagProvider\",\"index\":20,\"field\":\"upORdown\"}","upstreamType":"{\"provider\":\"upStreamTypeProvider\",\"index\":30,\"field\":\"upstreamType\"}"}} | |
37 | - | |
38 | - | |
39 | -[upStream06] | |
40 | -body={"rows":10,"page":1,"sort":"id","order":"desc","metadata":{"created":"{\"provider\":\"datetimeProvider\",\"index\":10,\"field\":\"created\"}","upORdown":"{\"provider\":\"userFlagProvider\",\"index\":20,\"field\":\"upORdown\"}","upstreamType":"{\"provider\":\"upStreamTypeProvider\",\"index\":30,\"field\":\"upstreamType\"}"}} | |
41 | - | |
42 | - | |
43 | -[upStream07] | |
44 | -body={"rows":10,"page":1,"sort":"id","order":"desc","metadata":{"created":"{\"provider\":\"datetimeProvider\",\"index\":10,\"field\":\"created\"}","upORdown":"{\"provider\":\"userFlagProvider\",\"index\":20,\"field\":\"upORdown\"}","upstreamType":"{\"provider\":\"upStreamTypeProvider\",\"index\":30,\"field\":\"upstreamType\"}"}} | |
45 | - | |
46 | -expect_response={"code":"200","data":951,"message":"创建客户订单成功","result":"创建客户订单成功","success":true} | |
47 | - | |
48 | - | |
49 | - | |
50 | - | |
51 | - |
config/global_data_backup.backup deleted
100644 → 0
1 | -# -*- coding: UTF-8 -*- | |
2 | - | |
3 | -[account] | |
4 | -user01=sg_wenze&111111 | |
5 | -user02=sgwanggang&111111 | |
6 | -user03=hz_wenze&111111 | |
7 | - | |
8 | -[userId] | |
9 | -user01=210 | |
10 | -user02=87 | |
11 | -user03=256 | |
12 | - | |
13 | -[environment] | |
14 | -en=http://test. | |
15 | - | |
16 | -[mark] | |
17 | -list=["test"] | |
18 | -list1=["p1","P2",1,"test"] | |
19 | - | |
20 | -[Database] | |
21 | -dbhost=10.35.100.34 | |
22 | -dbport=3306 | |
23 | -dbname=dili_trace | |
24 | -dbuser=root | |
25 | -dbpassword=123456 | |
26 | -dbcharset=utf8 | |
27 | - | |
28 | -[email] | |
29 | -list=[] | |
30 | -list1=["lixi@diligrp.com","LI@diligrp.com"] | |
31 | - | |
32 | - | |
33 | - | |
34 | - | |
35 | - | |
36 | - |
config/api/login.conf renamed to testcase/doAudit/__init__.py
testcase/doAudit/test_doAudit.py
0 → 100644
1 | +#!/usr/bin/python | |
2 | +# -*- coding: UTF-8 -*- | |
3 | +import unittest | |
4 | +import urllib3 | |
5 | +import commons.ConfigDB as db | |
6 | +from commons import common as com | |
7 | +from commons.MySession import my | |
8 | +from commons.api.fieldConfig import fieldConfig | |
9 | +from commons.api.doAudit import doAudit | |
10 | +from commons.api.doAdd import doAdd | |
11 | +#作用为禁用请求安全提示,平时默认加上上面的urllib3语句就行 | |
12 | +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
13 | +ad=doAdd() | |
14 | +au=doAudit() | |
15 | +field=fieldConfig() | |
16 | + | |
17 | + | |
18 | + | |
19 | +class test_doAudit(unittest.TestCase): | |
20 | + | |
21 | + "登记单审核接口" | |
22 | + @classmethod | |
23 | + def setUpClass(cls): | |
24 | + #通过字段配置接口提前配置新增页的字段配置 | |
25 | + my.post(url=field.url,headers=field.header,json=field.body) | |
26 | + | |
27 | + def setUp(self): | |
28 | + #准备数据:新增一条登记单 | |
29 | + my.post(url=ad.url,headers=ad.header,json=ad.body) | |
30 | + #获取数据:从MYSQL获取新增登记单的id号--因为响应没有id,需要数据库查询 | |
31 | + self.code=db.mysql_selectOne("SELECT id FROM `dili_trace`.register_bill ORDER BY id DESC LIMIT 1")[0] | |
32 | + print("db id",self.code) | |
33 | + | |
34 | + @unittest.case_mark(my.mark()) | |
35 | + def test_doAudit_01(self): | |
36 | + "审核通过" | |
37 | + #请求url中的需要替换为新增登记单的id | |
38 | + url=au.url.replace("5888", str(self.code)) | |
39 | + print("数据处理后的url",url) | |
40 | + #进行GET请求 | |
41 | + re=my.get(url=url,headers=au.header) | |
42 | + #打印请求结果(可删除该代码,一般只在调试时使用) | |
43 | + print(re.json()) | |
44 | + #断言请求过程是否成功 | |
45 | + self.assertEqual(re.status_code, 200) | |
46 | + #断言响应数据中是否存在期望字符串 | |
47 | + self.assertTrue("'result':'操作成功'" in str(re.json()).replace(" ","")) | |
48 | + | |
49 | + | |
50 | + @unittest.case_mark(my.mark()) | |
51 | + def test_doAudit_02(self): | |
52 | + "审核不通过" | |
53 | + #请求url中的需要替换为新增登记单的id | |
54 | + url=au.url.replace("5888", str(self.code)).replace("verifyStatus=20", "verifyStatus=30") | |
55 | + #进行GET请求 | |
56 | + re=my.get(url=url,headers=au.header) | |
57 | + #打印请求结果(可删除该代码,一般只在调试时使用) | |
58 | + print(re.json()) | |
59 | + #断言请求过程是否成功 | |
60 | + self.assertEqual(re.status_code, 200) | |
61 | + #断言响应数据中是否存在期望字符串 | |
62 | + self.assertTrue("'result':'操作成功'" in str(re.json()).replace(" ","")) | |
63 | + | |
64 | + | |
65 | + @unittest.case_mark(my.mark()) | |
66 | + def test_doAudit_03(self): | |
67 | + "审核不通过" | |
68 | + #请求url中的需要替换为新增登记单的id | |
69 | + url=au.url.replace("5888", str(self.code)).replace("verifyStatus=20", "verifyStatus=10") | |
70 | + #进行GET请求 | |
71 | + re=my.get(url=url,headers=au.header) | |
72 | + #打印请求结果(可删除该代码,一般只在调试时使用) | |
73 | + print(re.json()) | |
74 | + #断言请求过程是否成功 | |
75 | + self.assertEqual(re.status_code, 200) | |
76 | + #断言响应数据中是否存在期望字符串 | |
77 | + self.assertTrue("'result':'操作成功'" in str(re.json()).replace(" ","")) | |
78 | + | |
79 | + @unittest.case_mark(my.mark()) | |
80 | + def test_doAudit_04(self): | |
81 | + "审核一个已经完成审核的登记单" | |
82 | + #进行GET请求 | |
83 | + re=my.get(url=au.url,headers=au.header) | |
84 | + #打印请求结果(可删除该代码,一般只在调试时使用) | |
85 | + print(re.json()) | |
86 | + #断言请求过程是否成功 | |
87 | + self.assertEqual(re.status_code, 200) | |
88 | + #断言响应数据中是否存在期望字符串 | |
89 | + self.assertTrue("'result':'操作失败,数据状态已改变'" in str(re.json()).replace(" ","")) | |
90 | + | |
91 | + @classmethod | |
92 | + def tearDownClass(cls): | |
93 | + pass | |
94 | + | |
95 | + | |
96 | +if __name__ == "__main__": | |
97 | + | |
98 | + # unittest.main(verbosity=2) | |
99 | + | |
100 | + com.run_one(test_doAudit("test_doAudit_01")) | ... | ... |