Commit 0c818a491fef685707f82b374ad40d095e6af4eb

Authored by lixi
1 parent ba77adfe

删除多余用例

testcase/hg/loan_generalCustomer/__init__.py deleted 100644 → 0
testcase/hg/loan_generalCustomer/test_generalCustomerLoan.py deleted 100644 → 0
1 -#!/usr/bin/python  
2 -# -*- coding: UTF-8 -*-  
3 -import unittest  
4 -from commons import common as com  
5 -from commons import ConfigDB as db  
6 -from commons.MySession import my,hg  
7 -from commons.api.hg.loan_generalCustomer.generalCustomerLoan_save import generalCustomerLoan_save  
8 -from commons.api.hg.loan_generalCustomer.generalCustomerLoan_delete import generalCustomerLoan_delete  
9 -from commons.api.hg.loan_generalCustomer.generalCustomerLoan_list import generalCustomerLoan_list  
10 -from commons.api.hg.loan_generalCustomer.generalCustomerLoan_enforce import generalCustomerLoan_enforce  
11 -from commons.basic.registerRecord_save import registerRecord_save  
12 -from commons.basic.createAndTrade import createAndTrade  
13 -g=generalCustomerLoan_save()  
14 -l=generalCustomerLoan_list()  
15 -d=generalCustomerLoan_delete()  
16 -e=generalCustomerLoan_enforce()  
17 -r=registerRecord_save()  
18 -c=createAndTrade()  
19 -  
20 -  
21 -class test_generalCustomerLoan(unittest.TestCase):  
22 - "杭果市场-借款管理-普通客户借款"  
23 -  
24 - @classmethod  
25 - def setUpClass(cls) :  
26 - #存储进门的批次号  
27 - cls.batch=[]  
28 - #生成两单进门批号  
29 - for i in range(2):  
30 - #新增一个进门批号单  
31 - re=hg.post(url=r.url,headers=r.header,json=r.body1)  
32 - #获取批号  
33 - cls.batch.append(re.json()["data"]["batchCode"])  
34 - #普通客户使用进门批号生成交易单  
35 - body=c.body1.copy()  
36 - body["orderItemList"][0]["batchCode"]=cls.batch  
37 - re1=hg.post(url=c.url,headers=c.header,json=body)  
38 -  
39 -  
40 - @unittest.case_mark(my.mark())  
41 - def test_generalCustomerLoan_01_save(self):  
42 - "新增预支款:根据批次号新增预支款"  
43 - #生成两个普通借款单  
44 - for i in range(2):  
45 - #替换批次号  
46 - body=g.body.copy()  
47 - body["batch"]=self.batch[i]  
48 - #请求  
49 - re=hg.post(url=g.url,headers=g.header,json=body)  
50 - print(re.json(),"普通借款批次号",self.batch[i])  
51 - self.assertEqual(re.status_code, 200)  
52 - self.assertTrue("操作成功" in str(re.json()).replace(" ",""))  
53 -  
54 -  
55 - @unittest.skipDepend(depend="test_generalCustomerLoan_01_save")  
56 - @unittest.case_mark(my.mark())  
57 - def test_generalCustomerLoan_02_list(self):  
58 - "列表-查询:执行状态,客户,批号和结算日期都输入合法值,查询指定借款数据"  
59 - #修改查询的值  
60 - body=l.body.copy()  
61 - body["batch"] = self.batch[0]  
62 - # body["settleDateStart"]=com.dates()  
63 - # body["settleDateEnd"] = com.dates()  
64 - #请求  
65 - re=hg.post(url=l.url,headers=l.header,json=body)  
66 - print(re.json())  
67 - #断言  
68 - self.assertEqual(re.status_code, 200)  
69 - self.assertTrue("操作成功" in str(re.json()).replace(" ",""))  
70 - self.assertTrue(self.batch[0] in str(re.json()).replace(" ",""))  
71 -  
72 -  
73 - @unittest.skipDepend(depend="test_generalCustomerLoan_01_save")  
74 - @unittest.case_mark(my.mark())  
75 - def test_generalCustomerLoan_03_delete(self):  
76 - "列表-撤销:撤销一个未执行的借款单"  
77 - #查询批次号对应id  
78 - batch_id=db.mysql_selectOne(d.sql.replace("2109000088",self.batch[0]))[0]  
79 - #替换url的批次id  
80 - url=d.url.replace("66",str(batch_id))  
81 - #请求  
82 - re=hg.get(url=url,headers=d.header)  
83 - print(re.json(),"删除的普通借款批次号号和id",self.batch[0],batch_id)  
84 - #断言  
85 - self.assertEqual(re.status_code, 200)  
86 - self.assertTrue("操作成功" in str(re.json()).replace(" ",""))  
87 -  
88 -  
89 - @unittest.skipDepend(depend="test_generalCustomerLoan_01_save")  
90 - @unittest.case_mark(my.mark())  
91 - def test_generalCustomerLoan_04_enforce(self):  
92 - "列表-执行:执行一个未执行的借款单"  
93 - #查询批次号对应id  
94 - batch_id=db.mysql_selectOne(d.sql.replace("2109000088",self.batch[1]))[0]  
95 - #替换url的批次id  
96 - url=e.url.replace("66",str(batch_id))  
97 - #请求  
98 - re=hg.get(url=url,headers=e.header)  
99 - print(re.json(),"执行的普通借款批次号号和id",self.batch[1],batch_id)  
100 - #断言  
101 - self.assertEqual(re.status_code, 200)  
102 - self.assertTrue("操作成功" in str(re.json()).replace(" ",""))  
103 -  
104 -  
105 -  
106 -if __name__ == "__main__":  
107 -  
108 - unittest.main(verbosity=2)  
109 - # com.run_one(test_generalCustomerLoan("test_generalCustomerLoan_01_save"))  
testcase/hg/loan_vipCustomer/__init__.py deleted 100644 → 0
testcase/hg/loan_vipCustomer/test_getSingleWithoutValidate.py deleted 100644 → 0
1 -#!/usr/bin/python  
2 -# -*- coding: UTF-8 -*-  
3 -import unittest  
4 -from commons import common as com  
5 -from commons.MySession import my,hg  
6 -from commons.api.hg.loan_vipCustomer.getSingleWithoutValidate import getSingleWithoutValidate  
7 -g=getSingleWithoutValidate()  
8 -  
9 -  
10 -  
11 -class test_getSingleWithoutValidate(unittest.TestCase):  
12 - "杭果市场-借款管理-大客户借款"  
13 -  
14 - @unittest.case_mark(my.mark())  
15 - def test_getSingleWithoutValidate_01(self):  
16 - "新增-刷卡:刷卡查询园区卡信息"  
17 - re=hg.post(url=g.url,headers=g.header,json=g.body)  
18 - print(re.json())  
19 - self.assertEqual(re.status_code, 200)  
20 - self.assertTrue("'特朗普vip'" in str(re.json()).replace(" ",""))  
21 -  
22 -  
23 -if __name__ == "__main__":  
24 -  
25 - unittest.main(verbosity=2)  
26 -  
27 - # com.run_one(test_weightBizBill_listPage("test_weightBizBill_listPage_01"))  
testcase/hg/loan_vipCustomer/test_specialLoanQuery.py deleted 100644 → 0
1 -#!/usr/bin/python  
2 -# -*- coding: UTF-8 -*-  
3 -import unittest  
4 -from commons import common as com  
5 -from commons.MySession import my,hg  
6 -from commons.api.hg.loan_vipCustomer.specialLoanQuery import specialLoanQuery  
7 -s=specialLoanQuery()  
8 -  
9 -  
10 -  
11 -class test_specialLoanQuery(unittest.TestCase):  
12 - "杭果市场-借款管理-大客户借款"  
13 -  
14 - @unittest.case_mark(my.mark())  
15 - def test_specialLoanQuery_01(self):  
16 - "新增借款页-查询:点击新增,查询客户的订单信息"  
17 - #获取当天时间  
18 - body=s.body.copy()  
19 - body["tradeDateStart"]=com.dates()  
20 - body["tradeDateEnd"] = com.dates()  
21 - re=hg.post(url=s.url,headers=s.header,json=s.body)  
22 - print(re.json())  
23 - data=["未查询到交易信息","操作成功","该时间段已发生过预支借款,若还需要借款,请更改借款交易时间"]  
24 - self.assertEqual(re.status_code, 200)  
25 - if any(t in str(re.json()).replace(" ","") for t in data):  
26 - assert True  
27 - else:  
28 - assert False  
29 -  
30 -if __name__ == "__main__":  
31 -  
32 - unittest.main(verbosity=2)  
33 -  
34 - # com.run_one(test_weightBizBill_listPage("test_weightBizBill_listPage_01"))  
testcase/hg/loan_vipCustomer/test_vipCustomerLoan_details.py deleted 100644 → 0
1 -#!/usr/bin/python  
2 -# -*- coding: UTF-8 -*-  
3 -import unittest  
4 -from commons import common as com  
5 -from commons.MySession import my,hg  
6 -from commons.api.hg.loan_vipCustomer.vipCustomerLoan_details import vipCustomerLoan_details  
7 -vip=vipCustomerLoan_details()  
8 -  
9 -  
10 -  
11 -class test_vipCustomerLoan_details(unittest.TestCase):  
12 - "杭果市场-借款管理-大客户借款"  
13 -  
14 - @unittest.case_mark(my.mark())  
15 - def test_vipCustomerLoan_details_01(self):  
16 - "借款详情:选择指定大客户借款数据,点击查看"  
17 - re=hg.post(url=vip.url,headers=vip.header,json=vip.body)  
18 - print(re.json())  
19 - self.assertEqual(re.status_code, 200)  
20 - self.assertTrue("'操作成功'" in str(re.json()).replace(" ",""))  
21 - self.assertTrue("'特朗普vip'" in str(re.json()).replace(" ",""))  
22 -  
23 -  
24 -if __name__ == "__main__":  
25 -  
26 - unittest.main(verbosity=2)  
27 -  
28 - # com.run_one(test_weightBizBill_listPage("test_weightBizBill_listPage_01"))  
testcase/hg/loan_vipCustomer/test_vipCustomerLoan_list.py deleted 100644 → 0
1 -#!/usr/bin/python  
2 -# -*- coding: UTF-8 -*-  
3 -import unittest  
4 -from commons import common as com  
5 -from commons.MySession import my,hg  
6 -from commons.api.hg.loan_vipCustomer.vipCustomerLoan_list import vipCustomerLoan_list  
7 -vip=vipCustomerLoan_list()  
8 -  
9 -  
10 -  
11 -class test_vipCustomerLoan_list(unittest.TestCase):  
12 - "杭果市场-借款管理-大客户借款"  
13 -  
14 - @unittest.case_mark(my.mark())  
15 - def test_vipCustomerLoan_list_01(self):  
16 - "列表查询:客户,卡号和结算日期查输入合法值,查询一条指定数据"  
17 - re=hg.post(url=vip.url,headers=vip.header,json=vip.body)  
18 - print(re.json())  
19 - self.assertEqual(re.status_code, 200)  
20 - self.assertTrue("'特朗普vip'" in str(re.json()).replace(" ",""))  
21 -  
22 -  
23 -if __name__ == "__main__":  
24 -  
25 - unittest.main(verbosity=2)  
26 -  
27 - # com.run_one(test_weightBizBill_listPage("test_weightBizBill_listPage_01"))  
testcase/hg/test_batch/__init__.py deleted 100644 → 0
1 -# -*- coding: utf-8 -*-  
2 -  
3 -# @Time : 2021/9/8 17:46  
4 -# @Author : Ljq  
5 -# @File : __init__.py.py  
6 -# @Software: PyCharm  
7 -  
8 -"""  
9 -  
10 -"""  
testcase/hg/test_batch/test_batch.py deleted 100644 → 0
1 -# -*- coding: utf-8 -*-  
2 -  
3 -# @Time : 2021/9/10 10:17  
4 -# @Author : Ljq  
5 -# @File : test_batch.py  
6 -# @Software: PyCharm  
7 -  
8 -"""  
9 -杭果市场-结算管理-批号管理  
10 -"""  
11 -  
12 -from commons.MySession import sessionHg as session  
13 -from commons.api.hg.CheckIn import CheckIn  
14 -from commons.api.hg.settlement import batch  
15 -from commons.scripts.readConf import rC  
16 -import unittest,random  
17 -  
18 -class test_batch(unittest.TestCase):  
19 - """杭果市场-结算管理-批号管理"""  
20 - def setUp(self) -> None:  
21 - pass  
22 -  
23 - def tearDown(self) -> None:  
24 - pass  
25 -  
26 - @classmethod  
27 - def setUpClass(cls) -> None:  
28 - cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost")  
29 - cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost")  
30 - cls.ic = rC.returnOptionsItems("testInfo", "hg_cardNumRe_01")  
31 -  
32 - @classmethod  
33 - def tearDownClass(cls) -> None:  
34 - pass  
35 -  
36 - def test_searchState_1(self):  
37 - """  
38 - 批号管理--查询--输入【在售】状态的完整批号,查询出该批号下的相关数据  
39 - """  
40 - # 创建初始数据  
41 - resBatchCode = CheckIn.create_registerRecord(session=session, host=self.gatewayHost,ic=self.ic)  
42 - self.batchCode = resBatchCode.json()["data"]["batchCode"]  
43 - # 执行查询  
44 - print("test_searchState_1 --> self.batchCode:",self.batchCode)  
45 - resSearchState = batch.batchCodeQuery(session=session,host=self.gatewayHost,batchCode=self.batchCode)  
46 - print(resSearchState.json())  
47 - assert resSearchState.json()["code"] == "200","在售状态的登记单查询失败"  
48 - assert resSearchState.json()["state"] == 1,"在售状态的登记单查询失败"  
49 - assert resSearchState.json()["data"]["state"] == 1, "在售状态的登记单查询失败"  
50 - assert resSearchState.json()["data"]["batchCode"] == self.batchCode, "在售状态的登记单查询失败"  
51 -  
52 - def test_searchState_2(self):  
53 - """  
54 - 批号管理--查询--输入【关闭】状态的完整批号,查询出该批号下的相关数据  
55 - """  
56 - # 创建初始数据  
57 - resBatchCode = CheckIn.create_registerRecord(session=session, host=self.gatewayHost,ic=self.ic)  
58 - self.batchCode = resBatchCode.json()["data"]["batchCode"]  
59 - print("test_searchState_1 --> self.batchCode:", self.batchCode)  
60 - # 将批号关闭  
61 - resChange = batch.changeBatchCodeState(session=session,host=self.gatewayHost,batchCode=self.batchCode)  
62 - assert resChange.json()["message"] == "success","批号关闭成功"  
63 - # 执行查询  
64 - resSearchState = batch.batchCodeQuery(session=session,host=self.gatewayHost,batchCode=self.batchCode)  
65 - print(resSearchState.json())  
66 - assert resSearchState.json()["code"] == "200","在售状态的登记单查询失败"  
67 - assert resSearchState.json()["state"] == 2,"在售状态的登记单查询失败"  
68 - assert resSearchState.json()["data"]["state"] == 2, "在售状态的登记单查询失败"  
69 - assert resSearchState.json()["data"]["batchCode"] == self.batchCode, "在售状态的登记单查询失败"  
70 -  
71 - def test_batchDetails(self):  
72 - """  
73 - 批号管理--列表--【列表】中数据显示正确  
74 - """  
75 - # 创建初始数据  
76 - goodsName="西瓜"  
77 - weight = random.randint(50,100)  
78 - print("weight",weight)  
79 - resBatchCode = CheckIn.create_registerRecord(session=session, host=self.gatewayHost,ic=self.ic,goodsName=goodsName,  
80 - weight=weight)  
81 - self.batchCode = resBatchCode.json()["data"]["batchCode"]  
82 - print("test_searchState_1 --> self.batchCode:", self.batchCode)  
83 - # 执行查询  
84 - resSearchState = batch.batchCodeQuery(session=session,host=self.gatewayHost,batchCode=self.batchCode)  
85 - print(resSearchState.json())  
86 - assert resSearchState.json()["code"] == "200","查询状态码返回错误"  
87 - assert resSearchState.json()["data"]["batchCode"] == self.batchCode, "查询获得订单与实际订单不一致"  
88 - assert resSearchState.json()["data"]["registerDetail"][0]["categoryName"] == goodsName, "批号的商品信息与创建时不一致"  
89 - assert resSearchState.json()["data"]["registerDetail"][0]["weight"] == weight, "批号的重量信息与创建时不一致"  
90 -  
91 - def test_changeState_1(self):  
92 - """  
93 - 批号管理--恢复交款--“关闭”状态的批号,可【恢复交款】成功  
94 - """  
95 - # 创建初始数据  
96 - resBatchCode = CheckIn.create_registerRecord(session=session, host=self.gatewayHost,ic=self.ic)  
97 - self.batchCode = resBatchCode.json()["data"]["batchCode"]  
98 - print("test_searchState_1 --> self.batchCode:", self.batchCode)  
99 - # 将批号关闭  
100 - resChange = batch.changeBatchCodeState(session=session,host=self.gatewayHost,batchCode=self.batchCode,state=2)  
101 - assert resChange.json()["message"] == "success","批号关闭成功"  
102 - resChange = batch.changeBatchCodeState(session=session,host=self.gatewayHost,batchCode=self.batchCode,state=1)  
103 - assert resChange.json()["message"] == "success","批号关闭成功"  
104 - # 执行查询  
105 - resSearchState = batch.batchCodeQuery(session=session,host=self.gatewayHost,batchCode=self.batchCode)  
106 - print(resSearchState.json())  
107 - assert resSearchState.json()["data"]["state"] == 1, "在售状态的登记单查询失败"  
108 - assert resSearchState.json()["data"]["batchCode"] == self.batchCode, "在售状态的登记单查询失败"  
109 -  
110 - def test_changeState_2(self):  
111 - """  
112 - 批号管理--恢复交款--“在售”状态的批号,可【停止交款】成功  
113 - """  
114 - # 创建初始数据  
115 - resBatchCode = CheckIn.create_registerRecord(session=session, host=self.gatewayHost,ic=self.ic)  
116 - self.batchCode = resBatchCode.json()["data"]["batchCode"]  
117 - print("test_searchState_1 --> self.batchCode:", self.batchCode)  
118 - # 将批号关闭  
119 - resChange = batch.changeBatchCodeState(session=session,host=self.gatewayHost,batchCode=self.batchCode,state=2)  
120 - assert resChange.json()["message"] == "success","批号关闭成功"  
121 - # 执行查询  
122 - resSearchState = batch.batchCodeQuery(session=session,host=self.gatewayHost,batchCode=self.batchCode)  
123 - print(resSearchState.json())  
124 - assert resSearchState.json()["data"]["state"] == 2, "在售状态的登记单查询失败"  
125 - assert resSearchState.json()["data"]["batchCode"] == self.batchCode, "在售状态的登记单查询失败"  
testcase/hg/test_batchSettlement/__init__.py deleted 100644 → 0
1 -# -*- coding: utf-8 -*-  
2 -  
3 -# @Time : 2021/9/10 11:00  
4 -# @Author : Ljq  
5 -# @File : __init__.py.py  
6 -# @Software: PyCharm  
7 -  
8 -"""  
9 -  
10 -"""  
testcase/hg/test_batchSettlement/test_batchSettlement.py deleted 100644 → 0
1 -# -*- coding: utf-8 -*-  
2 -  
3 -# @Time : 2021/9/10 11:01  
4 -# @Author : Ljq  
5 -# @File : test_batchSettlement.py  
6 -# @Software: PyCharm  
7 -  
8 -"""  
9 -杭果市场-结算管理-批号管理  
10 -"""  
11 -  
12 -  
13 -from commons.api.hg.settlement import batch  
14 -from commons.api.hg.settlement import batchSettlement  
15 -from commons.api.hg.settlement import sellingGoods  
16 -from commons.MySession import sessionHg as session  
17 -from commons.api.hg.CheckIn import CheckIn  
18 -from commons.scripts.readConf import rC  
19 -import unittest,random  
20 -  
21 -class test_batch(unittest.TestCase):  
22 - """杭果市场-结算管理-批号管理"""  
23 - def setUp(self) -> None:  
24 - pass  
25 -  
26 - def tearDown(self) -> None:  
27 - pass  
28 -  
29 - @classmethod  
30 - def setUpClass(cls) -> None:  
31 - cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost")  
32 - cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost")  
33 - cls.ic = rC.returnOptionsItems("testInfo", "hg_cardNumRe_01")  
34 - cls.ic_buyer = rC.returnOptionsItems("testInfo", "hg_cardNumRe_02")  
35 - cls.posCode = rC.returnOptionsItems("testInfo", "hg_posCode_01")  
36 -  
37 - @classmethod  
38 - def tearDownClass(cls) -> None:  
39 - pass  
40 -  
41 - def test_searchBatchState_2(self):  
42 - """  
43 - 批号管理--查询--验证查询已关闭的批号自动加载批号信息  
44 - """  
45 - # 创建初始数据  
46 - posCode = self.posCode  
47 - state = "2"  
48 - resBatchCode = CheckIn.create_registerRecord(session=session, host=self.gatewayHost,ic=self.ic)  
49 - batchCode = resBatchCode.json()["data"]["batchCode"]  
50 - print("test_searchState_1 --> self.batchCode:", batchCode)  
51 - # 变更交易状态  
52 - resCAT = batch.changeBatchCodeState(session=session,host=self.gatewayHost,batchCode=batchCode,state=state)  
53 - print(resCAT.json())  
54 - assert resCAT.json()["code"]=="200","登记单状态变更失败"  
55 - # 结算单查询  
56 - res = batchSettlement.settle_query(session=session,host=self.gatewayHost,batchCode=batchCode)  
57 - print(res.text)  
58 - assert "tradingOrder" in res.text,"验证查询已关闭的批号自动加载批号信息"  
59 -  
60 - def test_searchBatchState_1(self):  
61 - """  
62 - 批号管理--查询--验证查询已关闭的批号自动加载批号信息  
63 - """  
64 - # 创建初始数据  
65 - posCode = self.posCode  
66 - state = "2"  
67 - resBatchCode = CheckIn.create_registerRecord(session=session, host=self.gatewayHost,ic=self.ic)  
68 - print(resBatchCode.json())  
69 - batchCode = resBatchCode.json()["data"]["batchCode"]  
70 - print("test_searchState_1 --> self.batchCode:", batchCode)  
71 - # # 变更交易状态  
72 - # resCAT = sellingGoods.doCreateAndTrade(session=session,host=self.gatewayHost,batchCode=batchCode,  
73 - # ic=self.ic_buyer,posCode=posCode)  
74 - # print(resCAT.json())  
75 \ No newline at end of file 0 \ No newline at end of file
testcase/hg/tradingOrder/test_Key_customer_login.py deleted 100644 → 0
1 -import unittest  
2 -import urllib3  
3 -urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)  
4 -from commons.MySession import hg,my  
5 -from commons.api.hg.transaction.Key_customer_login import Key_customer_login  
6 -kcl = Key_customer_login()  
7 -  
8 -"""  
9 -大客户登录  
10 -"""  
11 -  
12 -class test_Key_customer_login(unittest.TestCase):  
13 - "大客户登录"  
14 - @classmethod  
15 - def setUpClass(cls):  
16 - pass  
17 -  
18 - @unittest.case_mark(my.mark())  
19 - def test_Key_customer_login_01(self):  
20 - "大客户登录"  
21 - body = kcl.body.copy()  
22 - re = hg.post(url = kcl.url, headers = kcl.header, json = body)  
23 - print(re.json())  
24 - self.assertEqual(re.status_code, 200)  
25 - self.assertTrue("'登录成功'" in str(re.json()).replace(" ", ""))  
26 - self.assertEqual(re.json()["data"]["user"]["state"], 1,"为1时是大客户")  
27 - @classmethod  
28 - def tearDownClass(cls):  
29 - pass  
30 -  
31 -  
32 -if __name__ == '__main__':  
33 - unittest.main()  
testcase/hg/tradingOrder/test_createAndTrade.py deleted 100644 → 0
1 -import unittest  
2 -import urllib3  
3 -urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)  
4 -from commons.MySession import hg,my  
5 -from commons import ConfigDB as db  
6 -from commons.api.hg.transaction.createAndTrade import createAndTrade  
7 -from commons.basic.registerRecord_save import registerRecord_save  
8 -creat = createAndTrade()  
9 -r = registerRecord_save()  
10 -  
11 -"""  
12 -创建大客户订单  
13 -"""  
14 -  
15 -class test_createAndTrade(unittest.TestCase):  
16 - "创建大客户订单"  
17 - @classmethod  
18 - def setUpClass(cls):  
19 - # 新增一个进门批号单  
20 - # 新增一个进门批号单  
21 - # cls.aaa = db.mysql_selectOne('''  
22 - # SELECT  
23 - # aua.account_id,auc.card_no,aua.customer_id,aua.customer_code,aua.customer_name,aua.customer_certificate_number  
24 - # FROM  
25 - # ( `dili_account`.`account_user_account` AS aua LEFT JOIN `dili_account`.`account_user_card` AS auc ON aua.account_id = auc.account_id )  
26 - # LEFT JOIN `dili-customer`.`special_permissions` AS sp ON aua.customer_id = sp.customer_id  
27 - # ORDER BY aua.account_id DESC LIMIT 1  
28 - # ''')  
29 - cls.aaa = db.mysql_selectOne('''  
30 - SELECT  
31 - aua.account_id AS "账号id",  
32 - auc.card_no AS "园区卡号",  
33 - aua.customer_id AS "客户id",  
34 - aua.customer_code AS "客户code",  
35 - aua.customer_name AS "客户姓名",  
36 - aua.customer_certificate_number AS "客户身份证号码",  
37 - aua.hold_contacts_phone AS "持卡人电话"  
38 -FROM  
39 - ( `dili_account`.`account_user_account` AS aua LEFT JOIN `dili_account`.`account_user_card` AS auc ON aua.account_id = auc.account_id )  
40 - LEFT JOIN `dili-customer`.`special_permissions` AS sp ON aua.customer_id = sp.customer_id  
41 -WHERE  
42 - sp.customer_id = 141962 AND sp.market_id =15  
43 -ORDER BY  
44 - aua.account_id DESC  
45 - LIMIT 1  
46 - ''')  
47 - body2 = r.body.copy()  
48 - body2["accountId"] = str(cls.aaa[0])  
49 - body2["cardNo"] = str(cls.aaa[1])  
50 - body2["customerId"] = str(cls.aaa[2])  
51 - body2["customerCode"] = str(cls.aaa[3])  
52 - body2["customerName"] = str(cls.aaa[4])  
53 - body2["identityCardNo"] = str(cls.aaa[5])  
54 - body2["mobilephoneNumber"] = str(cls.aaa[6])  
55 - body2["categoryId"] = 44  
56 - body2["categoryCode"] = 754107  
57 - body2["categoryName"] = "葡萄"  
58 - re = hg.post(url = r.url, headers = r.header, json = body2)  
59 - "获取批号"  
60 - print("获取批号结果:",re.json())  
61 - cls.batch = re.json()["data"]["batchCode"]  
62 - return cls.batch  
63 -  
64 - @unittest.case_mark(my.mark())  
65 - def test_createAndTrade_01(self):  
66 - "大客户创建订单"  
67 - body = creat.body.copy()  
68 - body["orderItemList"][0]["batchCode"] = self.batch  
69 - print("创建订单body",body)  
70 - re1 = hg.post(url = creat.url, headers = creat.header, json = body)  
71 - print(re1.json())  
72 - self.assertEqual(re1.status_code, 200)  
73 - self.assertTrue("'操作成功'" in str(re1.json()).replace(" ", ""))  
74 - @classmethod  
75 - def tearDownClass(cls):  
76 - pass  
77 -  
78 -  
79 -if __name__ == '__main__':  
80 - unittest.main()  
testcase/hg/tradingOrder/test_l_createAndTrade.py deleted 100644 → 0
1 -import unittest  
2 -import urllib3  
3 -urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)  
4 -from commons.MySession import hg,my  
5 -from commons import ConfigDB as db  
6 -from commons.api.hg.transaction.l_createAndTrade import l_createAndTrade  
7 -from commons.basic.registerRecord_save import registerRecord_save  
8 -lcat = l_createAndTrade()  
9 -r = registerRecord_save()  
10 -  
11 -"""  
12 -创建普通客户订单  
13 -"""  
14 -  
15 -class test_l_createAndTrade(unittest.TestCase):  
16 - "创建普通客户订单"  
17 - @classmethod  
18 - def setUpClass(cls):  
19 - # 新增一个进门批号单  
20 - cls.aaa = db.mysql_selectOne('''  
21 - SELECT  
22 - aua.account_id AS "账号id",  
23 - auc.card_no AS "园区卡号",  
24 - aua.customer_id AS "客户id",  
25 - aua.customer_code AS "客户code",  
26 - aua.customer_name AS "客户姓名",  
27 - aua.customer_certificate_number AS "客户身份证号码",  
28 - aua.hold_contacts_phone AS "持卡人电话"  
29 -FROM  
30 - ( `dili_account`.`account_user_account` AS aua LEFT JOIN `dili_account`.`account_user_card` AS auc ON aua.account_id = auc.account_id )  
31 - LEFT JOIN `dili-customer`.`special_permissions` AS sp ON aua.customer_id = sp.customer_id  
32 -WHERE  
33 - sp.customer_id = 141962 AND sp.market_id =15  
34 -ORDER BY  
35 - aua.account_id DESC  
36 - LIMIT 1  
37 - ''')  
38 - body2 = r.body1.copy()  
39 - body2["accountId"] = str(cls.aaa[0])  
40 - body2["cardNo"] = str(cls.aaa[1])  
41 - body2["customerId"] = str(cls.aaa[2])  
42 - body2["customerCode"] = str(cls.aaa[3])  
43 - body2["customerName"] = str(cls.aaa[4])  
44 - body2["identityCardNo"] = str(cls.aaa[5])  
45 - body2["mobilephoneNumber"] = str(cls.aaa[6])  
46 - body2["categoryId"] = 44  
47 - body2["categoryCode"] = 754107  
48 - body2["categoryName"] = "葡萄"  
49 - re = hg.post(url = r.url, headers = r.header, json = body2)  
50 - "获取批号"  
51 - print("获取批号结果:",re.json())  
52 - cls.batch = re.json()["data"]["batchCode"]  
53 - return cls.batch  
54 -  
55 - @unittest.case_mark(my.mark())  
56 - def test_l_createAndTrade_01(self):  
57 - "普通客户创建订单"  
58 - body = lcat.body.copy()  
59 - body["orderItemList"][0]["batchCode"] = self.batch  
60 - print("创建订单body",body)  
61 - re1 = hg.post(url = lcat.url, headers = lcat.header, json = body)  
62 - print(re1.json())  
63 - self.assertEqual(re1.status_code, 200)  
64 - self.assertTrue("'操作成功'" in str(re1.json()).replace(" ", ""))  
65 - @classmethod  
66 - def tearDownClass(cls):  
67 - pass  
68 -  
69 -  
70 -if __name__ == '__main__':  
71 - unittest.main()  
testcase/hg/tradingOrder/test_ordinary_customer_login.py deleted 100644 → 0
1 -import unittest  
2 -import urllib3  
3 -urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)  
4 -from commons.MySession import hg,my  
5 -from commons.api.hg.transaction.ordinary_customer_login import ordinary_customer_login  
6 -ocl = ordinary_customer_login()  
7 -  
8 -"""  
9 -普通客户登录  
10 -"""  
11 -  
12 -class test_Key_customer_login(unittest.TestCase):  
13 - "普通客户登录"  
14 - @classmethod  
15 - def setUpClass(cls):  
16 - pass  
17 -  
18 - @unittest.case_mark(my.mark())  
19 - def test_Key_customer_login_01(self):  
20 - "普通客户登录"  
21 - body = ocl.body.copy()  
22 - re = hg.post(url = ocl.url, headers = ocl.header, json = body)  
23 - print(re.json())  
24 - self.assertEqual(re.status_code, 200)  
25 - self.assertTrue("'登录成功'" in str(re.json()).replace(" ", ""))  
26 - self.assertNotEqual(re.json()["data"]["user"]["state"], 1,"为1时是大客户")  
27 - @classmethod  
28 - def tearDownClass(cls):  
29 - pass  
30 -  
31 -  
32 -if __name__ == '__main__':  
33 - unittest.main()