test_weighingServiceSave.py
1.53 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
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import unittest
import urllib3
from commons import common as com
from commons.MySession import my,sy1
from commons.api.weighingServiceSave import weighingServiceSave
from commons.basic.listCarType import listCarType
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
we=weighingServiceSave(sy1)
li=listCarType(sy1)
class test_weighingServiceSave(unittest.TestCase):
"称重服务"
@classmethod
def setUpClass(cls):
pass
def setUp(self) :
we.refresh_commit_token()
@unittest.case_mark(my.mark())
def test_weighingServiceSave_01(self):
"称重服务:成功新增一条称重服务单"
print(self.__doc__)
body=we.body.copy()
car=li.car_list()["data"]
body["carTypeId"]=car[0]["id"]
body["carTypeName"]=car[0]["carTypeName"]
body["carTypeCode"]=car[0]["code"]
re=sy1.post(url=we.url,headers=we.header,json=body)
print(re.json())
self.assertEqual(re.status_code, 200)
self.assertTrue("'message':'交费成功','result':'交费成功','success':True" in str(re.json()).replace(" ",""))
@unittest.case_mark(my.mark())
def test_weighingServiceSave_02(self):
"称重服务:成功新增一条称重服务单"
print("11111111111111111111111111111111111")
if __name__ == "__main__":
# unittest.main(verbosity=2)
com.run_list([test_weighingServiceSave("test_weighingServiceSave_01"),test_weighingServiceSave("test_weighingServiceSave_02")])