test_weighingServiceSave.py
1.33 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
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import unittest
import urllib3
from commons import common as com
from commons.MySession import my,heb
from commons.api.sy.weighingServiceSave import weighingServiceSave
from commons.basic.listCarType import listCarType
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
we=weighingServiceSave(heb)
li=listCarType(heb)
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):
"称重服务:成功新增一条称重服务单"
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=heb.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(" ",""))
if __name__ == "__main__":
# unittest.main(verbosity=2)
com.run_list([test_weighingServiceSave("test_weighingServiceSave_01"),test_weighingServiceSave("test_weighingServiceSave_02")])