Commit 3b63adae17786906562ccaa004b5ddc1fbc2c230
1 parent
b032612f
xuefen
Showing
11 changed files
with
288 additions
and
9 deletions
atdd/ATDDCase.py
... | ... | @@ -9,17 +9,31 @@ import requests |
9 | 9 | |
10 | 10 | class ATDDCase(unittest.TestCase): |
11 | 11 | |
12 | - #全局变量 | |
12 | + # 全局变量 -yq环境 | |
13 | 13 | |
14 | 14 | global list |
15 | - host = "https://yq.vchangyi.com" | |
16 | - uc_host = "http://l-rst.vchangyi.com" | |
17 | - domain = '755DD9770A69039F18591A2906A3C371' # 企业号“小仙女” | |
18 | - | |
15 | + # host = "https://yq.vchangyi.com" | |
16 | + # | |
17 | + # uc_host = "http://restapi.99hr.com" | |
18 | + # domain = 'ECF532420A6916AB184EB6409E7FE413' | |
19 | + # mobile = '17321009308' | |
20 | + # psw = '222222' | |
21 | + # jipeihong_uid = '755DE0550A69039F0BA12102F4A4F8E1' # 季培红的UID | |
22 | + # cert = ('1_vchangyi.com_bundle.crt', '2_vchangyi.com.key') | |
23 | + # | |
24 | + # header_json = {"Content-Type": "application/json; charset=utf-8"} | |
25 | + # header_form = {"Content-Type": "application/x-www-form-urlencoded; charset=utf-8"} | |
26 | + | |
27 | + | |
28 | + # 测试环境 | |
29 | + global list | |
30 | + host = "https://yuanquan.vchangyi.com" | |
31 | + uc_host = "http://t-rst.vchangyi.com" | |
32 | + domain = '6F91FA1D7F00000106413BB6F47A9F54' # 企业号“颤抖的小包包” | |
19 | 33 | |
20 | 34 | mobile = '17321009308' |
21 | - psw = '222222' | |
22 | - jipeihong_uid = '755DE0550A69039F0BA12102F4A4F8E1' # 季培红的UID | |
35 | + psw = 'test123456' | |
36 | + jipeihong_uid = '6F920BAB7F00000169D1924CB1318A56' # 季培红的UID | |
23 | 37 | cert = ('1_vchangyi.com_bundle.crt', '2_vchangyi.com.key') |
24 | 38 | |
25 | 39 | header_json = {"Content-Type": "application/json; charset=utf-8"} |
... | ... | @@ -29,7 +43,6 @@ class ATDDCase(unittest.TestCase): |
29 | 43 | # 全局cookie |
30 | 44 | session = requests.Session() |
31 | 45 | |
32 | - | |
33 | 46 | def parse_array(self, prop, value_array): |
34 | 47 | req_params = {} |
35 | 48 | count = 0 |
... | ... | @@ -46,7 +59,6 @@ class ATDDCase(unittest.TestCase): |
46 | 59 | |
47 | 60 | return req_params |
48 | 61 | |
49 | - | |
50 | 62 | def tearDown(self): |
51 | 63 | if self.session is not None: |
52 | 64 | self.session.close() | ... | ... |
atdd/UcPost.py
0 → 100644
1 | +from atdd.ATDDCase import ATDDCase | |
2 | +import json | |
3 | + | |
4 | +class UcPost(ATDDCase): | |
5 | + | |
6 | + def UcPost(self, interfaceUrl, data=None, **options): | |
7 | + self.interfaceUrl = interfaceUrl | |
8 | + self.data = data | |
9 | + app = "yuanquan" | |
10 | + | |
11 | + url = self.uc_host + "/a/" + self.domain + '/' + app + interfaceUrl | |
12 | + r = self.post(url, self.data, **options) | |
13 | + self.assertEqual(200, r.status_code) | |
14 | + result = json.loads(r.text) | |
15 | + errcode = result['errcode'] | |
16 | + self.assertEqual(0, errcode) | |
17 | + return result | ... | ... |
atdd/__pycache__/ATDDCase.cpython-36.pyc
No preview for this file type
atdd/__pycache__/PcPost.cpython-36.pyc
No preview for this file type
tests/Pay/deduction_consum.py
0 → 100644
1 | +import unittest | |
2 | +import json | |
3 | +from atdd.ATDDCase import ATDDCase | |
4 | + | |
5 | +class Consum(ATDDCase): | |
6 | + def setUp(self): | |
7 | + pass | |
8 | + | |
9 | + def test_deduction_consum(self): | |
10 | + app = 'live' | |
11 | + header_json = {"Content-Type": "application/json; charset=utf-8"} | |
12 | + url = self.uc_host + '/b/' + self.domain + "/qy/live-cast-expend/consum" | |
13 | + data = { | |
14 | + "enterprise": self.domain, | |
15 | + "app": app, | |
16 | + "lcelSpendAmout": 100, | |
17 | + "lcelType": 1, | |
18 | + "liveCastId":"" | |
19 | + | |
20 | + } | |
21 | + print(url, json.dumps(data)) | |
22 | + result = self.post(url, None, json=data, headers=header_json) | |
23 | + print(result.json()) | |
24 | + | |
25 | +if __name__ == '__main__': | |
26 | + unittest.main() | ... | ... |
tests/Pay/invoice_update.py
0 → 100644
1 | +import unittest | |
2 | +import json | |
3 | +from atdd.ATDDCase import ATDDCase | |
4 | + | |
5 | +class Update(ATDDCase): | |
6 | + def setUp(self): | |
7 | + pass | |
8 | + | |
9 | + def test_invoice_update(self): | |
10 | + app = 'yuanquan' | |
11 | + header_json = {"Content-Type": "application/json; charset=utf-8"} | |
12 | + url = self.uc_host + '/b/' + self.domain + "/qy/invoice/update" | |
13 | + data = { | |
14 | + "enterprise": self.domain, | |
15 | + "app": app, | |
16 | + "invoAmount": 200000, | |
17 | + "invoHeader": "123", | |
18 | + "invoType": "1", | |
19 | + "invoIdCode": "123", | |
20 | + "invoRegisterAddress": "12", | |
21 | + "invoRegisterPhone": "3", | |
22 | + "invoBankName": "3", | |
23 | + "invoAccout": "3", | |
24 | + "invoReceiver": "颤抖", | |
25 | + "invoReceiverPhone": "22", | |
26 | + "invoReceiverAddress": "22", | |
27 | + "invoId": "3FE0606D0A69039F3B3826CD62E919A6", | |
28 | + "invoStatus": 2, | |
29 | + "invoTime": 1521484789512, | |
30 | + "invoUpdated": 0, | |
31 | + "invoCompanyName": "123", | |
32 | + "invoContent": "软件服务费", | |
33 | + "invoCreated": 1521484789729, | |
34 | + "invoInvoiceStatus": 4, | |
35 | + "invoAuditTime": 1521484789729 | |
36 | + | |
37 | + } | |
38 | + print(url, json.dumps(data)) | |
39 | + result = self.post(url, None, json=data, headers=header_json) | |
40 | + print(result.json()) | |
41 | + | |
42 | +if __name__ == '__main__': | |
43 | + unittest.main() | ... | ... |
tests/Pay/order_update.py
0 → 100644
1 | +import unittest | |
2 | +import json | |
3 | +from atdd.ATDDCase import ATDDCase | |
4 | + | |
5 | +class Update(ATDDCase): | |
6 | + def setUp(self): | |
7 | + pass | |
8 | + | |
9 | + def test_order_update(self): | |
10 | + app = 'yuanquan' | |
11 | + header_json = {"Content-Type": "application/json; charset=utf-8"} | |
12 | + url = "http://t-rst.vchangyi.com/s/qy/pay/callback" # 测试环境 | |
13 | + # url = "http://restapi.99hr.com/s/qy/pay/callback" # 线上环境 | |
14 | + data = { | |
15 | + # "enterprise": self.domain, | |
16 | + # "app": app, | |
17 | + "ordId": "47D048487F0000016F121DB71D51BCE8", | |
18 | + # "ordPayStatus": 2, # 支付状态 | |
19 | + # "ordPayType": 3, # 支付方式 | |
20 | + "ordTransactionNo": "SF2018032117073511000865", | |
21 | + "ordPayAmout": 10000000 | |
22 | + } | |
23 | + print(url, json.dumps(data)) | |
24 | + result = self.post(url, None, json=data, headers=header_json) | |
25 | + print(result.json()) | |
26 | + | |
27 | + def test_get(self): | |
28 | + app = 'yuanquan' | |
29 | + header_json = {"Content-Type": "application/json; charset=utf-8"} | |
30 | + # url = "http://t-rst.vchangyi.com/s/qy/pay/callback" # 测试环境 | |
31 | + url = "http://restapi.99hr.com/b/C7B740560A69039F6A3653F6A294245F/qy/charge/get" # 线上环境 | |
32 | + data = { | |
33 | + | |
34 | + } | |
35 | + print(url, json.dumps(data)) | |
36 | + result = self.post(url, None, json=data, headers=header_json) | |
37 | + print(result.json()) | |
38 | + | |
39 | + def test_order_add(self): | |
40 | + app = 'live' | |
41 | + header_json = {"Content-Type": "application/json; charset=utf-8"} | |
42 | + url = self.uc_host + '/b/' + self.domain + "/qy/order/add" | |
43 | + data = { | |
44 | + "enterprise": self.domain, | |
45 | + "app": app, | |
46 | + "ordPayStatus": 2, | |
47 | + } | |
48 | + print(url, json.dumps(data)) | |
49 | + result = self.post(url, None, json=data, headers=header_json) | |
50 | + print(result.json()) | |
51 | + | |
52 | +if __name__ == '__main__': | |
53 | + unittest.main() | ... | ... |
tests/UC_xuefen/test_get_setting.py
0 → 100644
1 | +from atdd.ATDDCase import ATDDCase | |
2 | + | |
3 | + | |
4 | +# 人员信息查询接口 | |
5 | +class MemberList(ATDDCase): | |
6 | + | |
7 | + def setUp(self): | |
8 | + pass | |
9 | + | |
10 | + def test_get_setting(self): | |
11 | + app = "yuanquan" | |
12 | + header_json = {"Content-Type": "application/json; charset=utf-8"} | |
13 | + url = self.uc_host + "/a/" + self.domain + "/" + app + "/qy/integral/common/get-setting" | |
14 | + data = { | |
15 | + | |
16 | + } | |
17 | + result = self.post(url, json=data, headers=header_json) | |
18 | + print(url) | |
19 | + print(result.json()) | |
20 | + | |
21 | + def test_update_setting(self): | |
22 | + app = "yuanquan" | |
23 | + header_json = {"Content-Type": "application/json; charset=utf-8"} | |
24 | + url = self.uc_host + "/a/" + self.domain + "/" + app + "/qy/integral/common/update-setting" | |
25 | + data = { | |
26 | + | |
27 | + } | |
28 | + result = self.post(url, json=data, headers=header_json) | |
29 | + print(url) | |
30 | + print(result.json()) | ... | ... |
tests/UC_xuefen/test_integralIndexList.py
0 → 100644
1 | +from atdd.ATDDCase import ATDDCase | |
2 | + | |
3 | + | |
4 | +# 查询积分明细列表/分页(积分首页使用) | |
5 | +class IntegralIndexList(ATDDCase): | |
6 | + | |
7 | + def setUp(self): | |
8 | + pass | |
9 | + | |
10 | + def test_integralIndexList(self): | |
11 | + app = "integral" | |
12 | + header_json = {"Content-Type": "application/json; charset=utf-8"} | |
13 | + url = self.uc_host + "/a/" + self.domain + "/" + app + "/qy/integral/integralIndexList" | |
14 | + data = { | |
15 | + "memUid": self.jipeihong_uid, | |
16 | + "miType": "mi_type1" | |
17 | + } | |
18 | + result = self.post(url, json=data, headers=header_json) | |
19 | + print(url) | |
20 | + print(result.json()) | |
21 | + | |
22 | + # 积分/学分明细 | |
23 | + def test_detail(self): | |
24 | + app = "integral" | |
25 | + header_json = {"Content-Type": "application/json; charset=utf-8"} | |
26 | + url = self.uc_host + "/a/" + self.domain + "/" + app + "/qy/integral/detail" | |
27 | + data = { | |
28 | + "memUid": self.jipeihong_uid, | |
29 | + "miType": "mi_type1" | |
30 | + } | |
31 | + result = self.post(url, json=data, headers=header_json) | |
32 | + print(url) | |
33 | + print(result.json()) | ... | ... |
tests/UC_xuefen/test_member_list.py
0 → 100644
1 | +from atdd.ATDDCase import ATDDCase | |
2 | + | |
3 | + | |
4 | +# 人员信息查询接口 | |
5 | +class MemberList(ATDDCase): | |
6 | + | |
7 | + def setUp(self): | |
8 | + pass | |
9 | + | |
10 | + def test_member_list(self): | |
11 | + app = "yuanquan" | |
12 | + header_json = {"Content-Type": "application/json; charset=utf-8"} | |
13 | + url = self.uc_host + "/a/" + self.domain + "/" + app + "/qy/integral/member-list" | |
14 | + data = { | |
15 | + "pageNum": 2, | |
16 | + "miType": "mi_type1" | |
17 | + } | |
18 | + result = self.post(url, json=data, headers=header_json) | |
19 | + print(url) | |
20 | + print(result.json()) | ... | ... |
tests/UC_xuefen/test_update.py
0 → 100644
1 | + | |
2 | +from atdd.ATDDCase import ATDDCase | |
3 | + | |
4 | +# 手动变更用户积分 | |
5 | +class Update(ATDDCase): | |
6 | + | |
7 | + def setUp(self): | |
8 | + pass | |
9 | + | |
10 | + # 增加积分 | |
11 | + def test_update_add(self): | |
12 | + app = "yuanquan" | |
13 | + header_json = {"Content-Type": "application/json; charset=utf-8"} | |
14 | + url = self.uc_host + "/a/" + self.domain + "/" + app + "/qy/integral/update" | |
15 | + data = { | |
16 | + "milOptType": 2, | |
17 | + "miType": "mi_type1", | |
18 | + "integral": 100, | |
19 | + "uids": self.jipeihong_uid, | |
20 | + "remark": "测试", | |
21 | + "milCreateMemUsername": "季培红", | |
22 | + "milCreateMemUid": self.jipeihong_uid | |
23 | + } | |
24 | + result = self.post(url, json=data, headers=header_json) | |
25 | + print(url) | |
26 | + print(result.json()) | |
27 | + | |
28 | + # 扣减积分 | |
29 | + def test_update_detection(self): | |
30 | + app = "yuanquan" | |
31 | + header_json = {"Content-Type": "application/json; charset=utf-8"} | |
32 | + url = self.uc_host + "/a/" + self.domain + "/" + app + "/qy/integral/update" | |
33 | + data = { | |
34 | + "milOptType": 3, | |
35 | + "miType": "mi_type0", | |
36 | + "integral": 22, | |
37 | + "uids": self.jipeihong_uid, | |
38 | + "remark": "测试", | |
39 | + "milCreateMemUsername": "季培红", | |
40 | + "milCreateMemUid": self.jipeihong_uid | |
41 | + } | |
42 | + result = self.post(url, json=data, headers=header_json) | |
43 | + print(url) | |
44 | + print(result.json()) | |
45 | + | ... | ... |