|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
# -*- coding: utf-8 -*-
# @Time : 2021/8/12 17:34
# @Author : Ljq
# @File : test_HP.py
# @Software: PyCharm
"""
回皮功能接口测试
"""
import json
import unittest
from commons.scripts.readConf import rC
from commons.api import zcApi as zcA
|
|
16
|
from commons.api.entranceFeeBillList import entranceFeeBillList as eFBL
|
|
17
|
from commons.api.entranceFeeBillList import operationDoFreeze as oDF
|
|
18
19
20
|
from commons.api import hpApi
import time,random
|
|
21
22
|
class test_HPCreate(unittest.TestCase):
"""整车-车辆回皮"""
|
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
def setUp(self) -> None:
pass
def tearDown(self) -> None:
pass
@classmethod
def setUpClass(cls) -> None:
cls.gatewayHost = rC.returnOptionsItems("host", "gatewayHost")
cls.jmsfHost = rC.returnOptionsItems("host", "jmsfHost")
cls.ic = rC.returnOptionsItems("testInfo", "cardNumRe")
@classmethod
def tearDownClass(cls) -> None:
pass
def test_hp(self):
|
|
41
|
"""整车-车辆回皮:创建回皮进门单"""
|
|
42
|
plate = f"川B{random.randint(10000,99999)}"
|
|
43
|
goods = "雪莲果"
|
|
44
45
46
|
cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods)
print(cre_res.json())
number = cre_res.json()["data"]["number"]
|
|
47
|
aa = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic)
|
|
48
|
res,tareWeight = hpApi.do_backSkinWeighSave(host=self.gatewayHost,number=number)
|
|
49
50
51
52
|
assert res.json()["code"]=="200","回皮失败"
assert "data" in res.text,"回皮失败"
def test_SearchByPlate(self):
|
|
53
|
"""整车-车辆回皮:根据车牌号查询"""
|
|
54
55
56
57
58
|
plate = f"川B{random.randint(10000,99999)}"
goods="火龙果"
cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods)
print(cre_res.json())
number = cre_res.json()["data"]["number"]
|
|
59
|
aa = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic)
|
|
60
61
62
63
64
|
res = hpApi.get_listBackSkinTrucks(host=self.gatewayHost,plate=plate)
print(res.json())
assert res.json()["code"]=="200","车号查询失败"
assert res.json()["data"][-1]["number"]==number,"车号查询失败"
|
|
65
66
67
68
69
70
71
|
def test_SearchByNumber(self):
"""整车-车辆回皮:根据收费单号查询"""
plate = f"川B{random.randint(10000,99999)}"
goods="火龙果"
cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods)
print(cre_res.json())
number = cre_res.json()["data"]["number"]
|
|
72
|
aa = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic)
|
|
73
74
75
76
77
|
res = hpApi.get_listBackSkinTrucks(host=self.gatewayHost,number=number)
print(res.json())
assert res.json()["code"]=="200","车号查询失败"
assert res.json()["data"][-1]["number"]==number,"车号查询失败"
|
|
78
|
def test_SearchByCusName(self):
|
|
79
|
"""整车-车辆回皮:根据客户查询"""
|
|
80
81
82
83
84
85
86
87
|
plate = f"川B{random.randint(10000,99999)}"
goods="雪莲果"
ic = self.ic
customerName= eFBL.get_icCheck(host=self.jmsfHost,ic=ic).json()["data"]["aInfo"]["customerName"]
print(customerName)
cre_res = zcA.create_jmsf(host=self.gatewayHost,plate=plate,keyword=goods)
print(cre_res.json())
number = cre_res.json()["data"]["number"]
|
|
88
|
aa = oDF.do_freezeOrder(host=self.jmsfHost,attrValue=number,ic=self.ic)
|
|
89
90
91
92
|
res = hpApi.get_listBackSkinTrucks(host=self.gatewayHost,customerName=customerName)
print(res.json())
assert res.json()["code"]=="200","车号查询失败"
assert res.json()["data"][-1]["number"]==number,"车号查询失败"
|