test_entranceFeeBill_details.py
8.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import unittest
import urllib3
from commons import ConfigDB as db
from commons import common as com
from commons.MySession import my,sy1
from commons.api.entranceFeeBill_details import entranceFeeBill_details
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
en=entranceFeeBill_details()
class test_entranceFeeBill_details(unittest.TestCase):
"收费单标记"
@classmethod
def setUpClass(cls):
cls.data=db.mysql_selectOne(en.sql)
@unittest.case_mark(my.mark())
def test_entranceFeeBill_details_01(self):
"收费单标记-查询:查询条件为“收费单号”,其余查询条件输入合法值,查询一条指定数据"
url= en.url.replace("202108120900001", self.data[9]).\
replace("carTypeId=53", "carTypeId={}".format(self.data[0])).\
replace("categoryId=14436", "categoryId={}".format(self.data[1])).\
replace("dep=58", "dep={}".format(self.data[2])).\
replace("regionId=72", "regionId={}".format(self.data[3])).\
replace("status=4", "status={}".format(self.data[4])).\
replace("type=1", "type={}".format(self.data[5])).\
replace("backSkinStatus=-1", "backSkinStatus={}".format(self.data[6])).\
replace("companyId=9", "companyId={}".format(self.data[8]))
re=sy1.get(url=url,headers=en.header)
print(re.json())
self.assertEqual(re.status_code, 200)
self.assertTrue("'total':1" in str(re.json()).replace(" ",""))
self.assertTrue("'number':'{}'".format(self.data[9]) in str(re.json()).replace(" ",""))
@unittest.case_mark(my.mark())
def test_entranceFeeBill_details_02(self):
"收费单标记-查询:查询条件为“车牌号”,其余查询条件输入合法值,查询一条指定数据"
url= en.url.replace("202108120900001", self.data[10]).\
replace("carTypeId=53", "carTypeId={}".format(self.data[0])).\
replace("categoryId=14436", "categoryId={}".format(self.data[1])).\
replace("dep=58", "dep={}".format(self.data[2])).\
replace("regionId=72", "regionId={}".format(self.data[3])).\
replace("status=4", "status={}".format(self.data[4])).\
replace("type=1", "type={}".format(self.data[5])).\
replace("backSkinStatus=-1", "backSkinStatus={}".format(self.data[6])).\
replace("companyId=9", "companyId={}".format(self.data[8])).\
replace("attr=number", "attr=likePlate")
re=sy1.get(url=url,headers=en.header)
print(re.json())
self.assertEqual(re.status_code, 200)
self.assertTrue("'number':'{}'".format(self.data[9]) in str(re.json()).replace(" ",""))
@unittest.case_mark(my.mark())
def test_entranceFeeBill_details_03(self):
"收费单标记-查询:查询条件为“商品”,其余查询条件输入合法值,查询一条指定数据"
url= en.url.replace("202108120900001", self.data[11]).\
replace("carTypeId=53", "carTypeId={}".format(self.data[0])).\
replace("categoryId=14436", "categoryId={}".format(self.data[1])).\
replace("dep=58", "dep={}".format(self.data[2])).\
replace("regionId=72", "regionId={}".format(self.data[3])).\
replace("status=4", "status={}".format(self.data[4])).\
replace("type=1", "type={}".format(self.data[5])).\
replace("backSkinStatus=-1", "backSkinStatus={}".format(self.data[6])).\
replace("companyId=9", "companyId={}".format(self.data[8])).\
replace("attr=number", "attr=goods")
re=sy1.get(url=url,headers=en.header)
print(re.json())
self.assertEqual(re.status_code, 200)
self.assertTrue("'number':'{}'".format(self.data[9]) in str(re.json()).replace(" ",""))
@unittest.case_mark(my.mark())
def test_entranceFeeBill_details_04(self):
"收费单标记-查询:查询条件为“收费员”,其余查询条件输入合法值,查询一条指定数据"
url= en.url.replace("202108120900001", self.data[12]).\
replace("carTypeId=53", "carTypeId={}".format(self.data[0])).\
replace("categoryId=14436", "categoryId={}".format(self.data[1])).\
replace("dep=58", "dep={}".format(self.data[2])).\
replace("regionId=72", "regionId={}".format(self.data[3])).\
replace("status=4", "status={}".format(self.data[4])).\
replace("type=1", "type={}".format(self.data[5])).\
replace("backSkinStatus=-1", "backSkinStatus={}".format(self.data[6])).\
replace("companyId=9", "companyId={}".format(self.data[8])).\
replace("attr=number", "attr=pay")
re=sy1.get(url=url,headers=en.header)
print(re.json())
self.assertEqual(re.status_code, 200)
self.assertTrue("'number':'{}'".format(self.data[9]) in str(re.json()).replace(" ",""))
@unittest.case_mark(my.mark())
def test_entranceFeeBill_details_05(self):
"收费单标记-查询:查询条件为“客户姓名”,其余查询条件输入合法值,查询一条指定数据"
url= en.url.replace("202108120900001", self.data[13]).\
replace("carTypeId=53", "carTypeId={}".format(self.data[0])).\
replace("categoryId=14436", "categoryId={}".format(self.data[1])).\
replace("dep=58", "dep={}".format(self.data[2])).\
replace("regionId=72", "regionId={}".format(self.data[3])).\
replace("status=4", "status={}".format(self.data[4])).\
replace("type=1", "type={}".format(self.data[5])).\
replace("backSkinStatus=-1", "backSkinStatus={}".format(self.data[6])).\
replace("companyId=9", "companyId={}".format(self.data[8])).\
replace("attr=number", "attr=cname")
re=sy1.get(url=url,headers=en.header)
print(re.json())
self.assertEqual(re.status_code, 200)
self.assertTrue("'number':'{}'".format(self.data[9]) in str(re.json()).replace(" ",""))
@unittest.case_mark(my.mark())
def test_entranceFeeBill_details_06(self):
"收费单标记-查询:查询条件为“卡号”,其余查询条件输入合法值,查询一条指定数据"
url= en.url.replace("202108120900001", self.data[15]).\
replace("carTypeId=53", "carTypeId={}".format(self.data[0])).\
replace("categoryId=14436", "categoryId={}".format(self.data[1])).\
replace("dep=58", "dep={}".format(self.data[2])).\
replace("regionId=72", "regionId={}".format(self.data[3])).\
replace("status=4", "status={}".format(self.data[4])).\
replace("type=1", "type={}".format(self.data[5])).\
replace("backSkinStatus=-1", "backSkinStatus={}".format(self.data[6])).\
replace("companyId=9", "companyId={}".format(self.data[8])).\
replace("attr=number", "attr=ic")
re=sy1.get(url=url,headers=en.header)
print(re.json())
self.assertEqual(re.status_code, 200)
self.assertTrue("'number':'{}'".format(self.data[9]) in str(re.json()).replace(" ",""))
@unittest.case_mark(my.mark())
def test_entranceFeeBill_details_07(self):
"收费单标记-查询:查询条件为“手机号”,其余查询条件输入合法值,查询一条指定数据"
url= en.url.replace("202108120900001", self.data[14]).\
replace("carTypeId=53", "carTypeId={}".format(self.data[0])).\
replace("categoryId=14436", "categoryId={}".format(self.data[1])).\
replace("dep=58", "dep={}".format(self.data[2])).\
replace("regionId=72", "regionId={}".format(self.data[3])).\
replace("status=4", "status={}".format(self.data[4])).\
replace("type=1", "type={}".format(self.data[5])).\
replace("backSkinStatus=-1", "backSkinStatus={}".format(self.data[6])).\
replace("companyId=9", "companyId={}".format(self.data[8])).\
replace("attr=number", "attr=phone")
re=sy1.get(url=url,headers=en.header)
print(re.json())
self.assertEqual(re.status_code, 200)
self.assertTrue("'number':'{}'".format(self.data[9]) in str(re.json()).replace(" ",""))
if __name__ == "__main__":
unittest.main(verbosity=2)
# com.run_one(test_entranceFeeBill_details("test_entranceFeeBill_details_01"))