Commit b80f8d59a95a41166da889298e2a20e4c2994a1c

Authored by 175930106
Committed by liujiqiang
1 parent 7de68791

加入新增接口的用例,调整了其余用例中冗余的代码

src/commons/api/__pycache__/doAdd.cpython-36.pyc 0 → 100644
No preview for this file type
src/commons/api/__pycache__/fieldConfig.cpython-36.pyc 0 → 100644
No preview for this file type
src/commons/api/__pycache__/login.cpython-36.pyc
No preview for this file type
src/commons/api/__pycache__/upStream.cpython-36.pyc
No preview for this file type
src/commons/api/doAdd.py 0 → 100644
  1 +#!/usr/bin/python
  2 +# -*- coding: UTF-8 -*-
  3 +import requests
  4 +import json
  5 +import urllib3
  6 +from commons import common as com
  7 +from commons.api.login import login
  8 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  9 +ll=login()
  10 +
  11 +class doAdd():
  12 +
  13 + url="http://test.trace.diligrp.com:8393/newRegisterBill/doAdd.action"
  14 + header={
  15 + "Host": "test.trace.diligrp.com",
  16 + "Connection": "keep-alive",
  17 + "Content-Length": "325",
  18 + "Accept": "application/json,text/javascript,*/*;q=0.01",
  19 + "User-Agent": "Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/90.0.4430.212Safari/537.36",
  20 + "Content-Type": "application/json",
  21 + "Origin": "http://test.trace.diligrp.com:8393",
  22 + "Referer": "http://test.trace.diligrp.com:8393/newRegisterBill/add.html",
  23 + "Accept-Encoding": "gzip,deflate",
  24 + "Accept-Language": "zh-CN,zh-TW;q=0.9,zh;q=0.8,en;q=0.7"}
  25 + body={"registerHeadWeight":"0","registerHeadRemainWeight":"0","imageCertList":[],"measureType":20,"registType":10,"userId":516,"arrivalTallynos":[],"arrivalDatetime":"","truckType":10,"weight":"111","weightUnit":1,"productName":"大白菜","productId":2190,"originName":"","originId":"","unitPrice":"","truckTareWeight":"","remark":"","specName":"","brandName":"","plate":"川A123456"}
  26 +
  27 +
  28 + def __init__(self):
  29 + self.url=doAdd.url.replace("http://test.",com.get_global_config("global_data", "environment", "en") )
  30 + self.header=doAdd.header
  31 + self.body=doAdd.body
  32 +
  33 + def post(self,account,**kwargs):
  34 + #解决不同接口对于不同用户的场景
  35 + se=ll.get_session(account)
  36 + re=se.post(**kwargs)
  37 + ll.close_session()
  38 + return re
  39 +
  40 +
  41 +
  42 +
  43 +tt=doAdd()
  44 +tt.post("user01",url=tt.url,headers=tt.header,json=tt.body,proxies={'http': 'http://localhost:8888'})
  45 +
... ...
src/commons/api/fieldConfig.py
... ... @@ -3,13 +3,11 @@
3 3 import requests
4 4 import json
5 5 import urllib3
6   -from commons import ConfigDB as db
7 6 from commons import common as com
8 7 from commons.api.login import login
9 8 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
10 9 ll=login()
11 10  
12   -#列表查询
13 11 class fieldConfig(login):
14 12  
15 13 url="http://test.trace.diligrp.com:8393/fieldConfig/doUpdate.action"
... ... @@ -29,9 +27,9 @@ class fieldConfig(login):
29 27 body={"moduleType":"1","marketId":"8","fieldConfigDetailList":[{"fieldName":"unitPrice","jsonPath":"$.unitPrice","defaultId":"3","displayed":"1","required":"0"},{"fieldName":"arrivalTallynos","jsonPath":"$.arrivalTallynos","defaultId":"10","displayed":"1","required":"0"},{"fieldName":"brandName","jsonPath":"$.brandName","defaultId":"5","displayed":"1","required":"0"},{"fieldName":"truckTareWeight","jsonPath":"$.truckTareWeight","defaultId":"1","displayed":"1","required":"0"},{"fieldName":"originId","jsonPath":"$.originId","defaultId":"7","displayed":"1","required":"0"},{"fieldName":"specName","jsonPath":"$.specName","defaultId":"4","displayed":"1","required":"0"},{"fieldName":"truckType","jsonPath":"$.truckType","defaultId":"2","displayed":"1","required":"1","availableValueList":["10","20"]},{"fieldName":"imageCertList","jsonPath":"$.imageCertList[*]certType","defaultId":"11","displayed":"1","required":"0","availableValueList":["2","3"]},{"fieldName":"arrivalDatetime","jsonPath":"$.arrivalDatetime","defaultId":"9","displayed":"1","required":"0"},{"fieldName":"remark","jsonPath":"$.remark","defaultId":"8","displayed":"1","required":"0"},{"fieldName":"remark","jsonPath":"$.remark","defaultId":"6","displayed":"1","required":"0"},{"fieldName":"measureType","jsonPath":"$.measureType","defaultId":"12","displayed":"1","required":"1","availableValueList":["10","20"]}]}
30 28  
31 29 def __init__(self):
32   - self.url=login.url.replace("test.uap.diligrp.com",com.get_global_config("global_data", "environment", "en") )
33   - self.header=login.header
34   - self.body=login.body
  30 + self.url=fieldConfig.url.replace("http://test.",com.get_global_config("global_data", "environment", "en") )
  31 + self.header=fieldConfig.header
  32 + self.body=fieldConfig.body
35 33  
36 34 def post(self,account,**kwargs):
37 35 se=ll.get_session(account)
... ... @@ -39,14 +37,8 @@ class fieldConfig(login):
39 37 ll.close_session()
40 38 return re
41 39  
42   - def post2(self,session,account,**kwargs):
43   - #解决不同接口对于不同用户的场景
44   - se=ll.get_session(account)
45   - re=session.post(**kwargs)
46   - ll.close_session()
47   - return re
48 40  
49 41  
50 42 # tt=fieldConfig()
51   -
52   -# tt.demo("sg_wenze", "111111",proxies={'http': 'http://localhost:8888'})
  43 +#
  44 +# tt.post("user01",url=tt.url,headers=tt.header,json=tt.body,proxies={'http': 'http://localhost:8888', 'https': 'http://localhost:8888'})
... ...
src/commons/api/login.py
... ... @@ -3,11 +3,9 @@
3 3 import requests
4 4 import json
5 5 import urllib3
6   -from commons import ConfigDB as db
7 6 from commons import common as com
8 7 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
9 8  
10   -#列表查询
11 9 class login():
12 10 url="http://test.uap.diligrp.com/login/login.action"
13 11 header={
... ... @@ -27,7 +25,7 @@ class login():
27 25 body="userName=sg_wenze&password=111111"
28 26  
29 27 def __init__(self):
30   - self.url=login.url.replace("test.uap.diligrp.com",com.get_global_config("global_data", "environment", "en") )
  28 + self.url=login.url.replace("http://test.",com.get_global_config("global_data", "environment", "en") )
31 29 self.header=login.header
32 30 self.body=login.body
33 31  
... ... @@ -39,27 +37,16 @@ class login():
39 37 return self.se
40 38  
41 39 def close_session(self):
42   - print("close session")
43 40 self.se.close()
44 41  
45   - def post(self,name,password,firmid,**kwargs):
  42 + def post(self,name,password,**kwargs):
46 43 self.body=self.body.replace("sg_wenze", name)
47 44 self.body=self.body.replace("111111", password)
48   - re=requests.post(url=self.url, headers=self.header,data=self.body,**kwargs)
49   -
50   - print(re.headers)
  45 + re=requests.post(url=self.url, headers=self.header,data=self.body,allow_redirects=False,**kwargs)
51 46 return re
52 47  
53 48  
54 49 # t=login()
55   -# print(t.url)
56 50 # t.get_session2("user01",proxies={'http': 'http://localhost:8888', 'https': 'http://localhost:8888'},allow_redirects=False)
57 51  
58   -# t.post("sg_wenze", "111111",proxies={'http': 'http://localhost:8888', 'https': 'http://localhost:8888'})
59   -# def tt(**kwargs):
60   -# print(kwargs)
61   -
62   -# t.get_session(http="http://localhost:8888", https="http://localhost:8888")
63   -# t.post("sg_wenze", "1111111",proxies={'http': 'http://localhost:8888', 'https': 'http://localhost:8888'})
64   -
65 52  
... ...
src/commons/api/upStream.py
... ... @@ -3,14 +3,12 @@
3 3 import requests
4 4 import json
5 5 import urllib3
6   -from commons import ConfigDB as db
7 6 from commons import common as com
8 7 from commons.api.login import login
9 8 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
10 9 ll=login()
11 10  
12   -#列表查询
13   -class upStream(login):
  11 +class upStream():
14 12  
15 13 url="http://test.trace.diligrp.com:8393/upStream/listPage.action"
16 14 header={
... ... @@ -29,9 +27,9 @@ class upStream(login):
29 27  
30 28  
31 29 def __init__(self):
32   - self.url=login.url.replace("test.uap.diligrp.com",com.get_global_config("global_data", "environment", "en") )
33   - self.header=login.header
34   - self.body=login.body
  30 + self.url=upStream.url.replace("http://test.",com.get_global_config("global_data", "environment", "en") )
  31 + self.header=upStream.header
  32 + self.body=upStream.body
35 33  
36 34 def post(self,account,**kwargs):
37 35 #解决不同接口对于不同用户的场景
... ... @@ -40,7 +38,11 @@ class upStream(login):
40 38 ll.close_session()
41 39 return re
42 40  
43   -tt=upStream()
  41 +
  42 +
  43 +
  44 +# tt=upStream()
  45 +# print(tt.url)
44 46 # print(id(tt.body))
45 47 # print(id(upStream.body))
46 48 # tt.body["order"]=111
... ...
src/config/account.conf deleted 100644 → 0
1   -[account]
2   -sg_01=sg_wenze&111111
3   -sg_02=sg_wenze&111111
4   -sy_01=666
5   -sy_01=111
6   -hs_01=666
7   -hs_01=111
8   -
9   -[sy]
10   -username01=666
11   -password01=111
12   -username02=666
13   -password02=111
14   -
15   -[hs]
16   -username01=666
17   -password01=111
18   -username02=666
19   -password02=111
20   -
21   -
22   -[firmid]
23   -
24   -[evnironment]
25   -
26   -
27   -
28   -[Database]
29   -dbhost=10.28.10.169
30   -dbport=3306
31   -dbname=trace
32   -dbuser=root
33   -dbpassword=123456
34   -dbcharset=utf8
src/config/global_data.conf
... ... @@ -6,7 +6,7 @@ user02=sy_wenze&111111
6 6 user03=hz_wenze&111111
7 7  
8 8 [environment]
9   -en=test.uap.diligrp.com
  9 +en=http://test.
10 10  
11 11 [Database]
12 12 dbhost=10.28.10.169
... ...
src/testcase/doAdd/.gitignore 0 → 100644
  1 +/__init__.pyc
... ...
src/testcase/doAdd/__init__.py 0 → 100644
  1 +# -*- coding:utf-8 -*-
  2 +import binascii
  3 +import base64
  4 +import requests,json
  5 +import time
  6 +# import sys
  7 +# reload(sys)
  8 +# sys.setdefaultencoding('utf8')
0 9 \ No newline at end of file
... ...
src/testcase/doAdd/__pycache__/__init__.cpython-36.pyc 0 → 100644
No preview for this file type
src/testcase/doAdd/__pycache__/test_Systemskip.cpython-36.pyc 0 → 100644
No preview for this file type
src/testcase/doAdd/__pycache__/test_Userskip.cpython-36.pyc 0 → 100644
No preview for this file type
src/testcase/doAdd/__pycache__/test_tms_myrequest1.cpython-36.pyc 0 → 100644
No preview for this file type
src/testcase/doAdd/__pycache__/test_tms_myrequest_demo.cpython-36.pyc 0 → 100644
No preview for this file type
src/testcase/doAdd/__pycache__/test_upStream.cpython-36.pyc 0 → 100644
No preview for this file type
src/testcase/doAdd/test_doAdd.py 0 → 100644
  1 +#!/usr/bin/python
  2 +# -*- coding: UTF-8 -*-
  3 +import unittest
  4 +import json
  5 +import urllib3
  6 +from commons.api.login import login
  7 +from commons.api.fieldConfig import fieldConfig
  8 +from commons.api.doAdd import doAdd
  9 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
  10 +ll=login()
  11 +do=doAdd()
  12 +field=fieldConfig()
  13 +
  14 +#列表查询
  15 +class test_doAdd(unittest.TestCase):
  16 +
  17 + @classmethod
  18 + def setUpClass(cls):
  19 + #新增登记单
  20 + cls.se=ll.get_session("user01",allow_redirects=False)
  21 + field.post("user01",url=field.url,headers=field.header,json=field.body)
  22 +
  23 + def setUp(self):
  24 + pass
  25 +
  26 + def test_01_doAdd(self):
  27 + #成功新增一个商品为大白菜的报备单,重量为111
  28 + re=self.se.post(url=do.url,headers=do.header,json=do.body,proxies={'http': 'http://localhost:8888', 'https': 'http://localhost:8888'})
  29 + print(re.json())
  30 + self.assertEqual(re.status_code, 200)
  31 + self.assertTrue("'code':'200'" in str(re.json()).replace(" ",""))
  32 +
  33 + def test_02_doAdd(self):
  34 + #成功新增一个商品为鲜花生的报备单,重量为111
  35 + body=do.body.copy()
  36 + body["productName"]="鲜花生"
  37 + body["productId"]="3496"
  38 + re=self.se.post(url=do.url,headers=do.header,json=body,proxies={'http': 'http://localhost:8888', 'https': 'http://localhost:8888'})
  39 + print(re.json())
  40 + self.assertEqual(re.status_code, 200)
  41 + self.assertTrue("'code':'200'" in str(re.json()).replace(" ",""))
  42 +
  43 + def test_03_doAdd(self):
  44 + #用错误的用户来新增,无法新增
  45 + body=do.body.copy()
  46 + body["userId"]="516111"
  47 + re=self.se.post(url=do.url,headers=do.header,json=body,proxies={'http': 'http://localhost:8888', 'https': 'http://localhost:8888'})
  48 + print(re.json())
  49 + self.assertEqual(re.status_code, 200)
  50 + self.assertTrue("查询客户信息失败" in str(re.json()).replace(" ",""))
  51 +
  52 +
  53 + def tearDown(self):
  54 + pass
  55 +
  56 + @classmethod
  57 + def tearDownClass(cls):
  58 + cls.se.close()
  59 +
  60 +
  61 +
  62 +if __name__ == "__main__":
  63 +#unittest.main()方法会搜索该模块文件下所有以test开头的测试用例方法,并自动执行它们。
  64 +#如果不加下面这个语句,那么在通过unittest的方法添加测试用例时,这个文件里面的用例不会被搜索到。
  65 +
  66 +# unittest.main(verbosity=2)
  67 +
  68 +# # 以下代码可以调试单个测试用例,用例中打印的语句不会展示到控制台,使用前需要注释上面的代码unittest.main(),如果不使用下面代码,
  69 +# # 在有unittest.main()的情况下点击ctrl+f11,会直接运行当前页面所有用例,并且把用例用有打印的语句显示到控制台
  70 + current_suite = unittest.TestSuite()
  71 + current_suite.addTest(test_doAdd("test_03_doAdd"))
  72 +# #以列表形式添加多个测试用例
  73 +# # current_suite.addTests([submitOrder_With_Coupon("test_01"),submitOrder_With_Coupon("test_02")])
  74 +# # 执行测试
  75 + runner = unittest.TextTestRunner()
  76 +## runner.run(可以直接添加测试用例如submitOrder_With_Coupon("test_01"))
  77 + runner.run(current_suite)
0 78 \ No newline at end of file
... ...
src/testcase/fieldConfig/test_fieldConfig.py
... ... @@ -3,37 +3,31 @@
3 3 import unittest
4 4 import json
5 5 import urllib3
6   -from commons import ConfigDB as db
7   -from commons import common as com
8 6 from commons.api.login import login
9   -from commons.api.upStream import upStream
10   -from commons.MyRequest import myrequest
11 7 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
12 8 ll=login()
13   -uu=upStream()
14   -my=myrequest()
  9 +
15 10  
16 11  
17 12 class test_fieldConfig(unittest.TestCase):
18   - '''分别封装各个接口和数据,数据处理过程写入代码'''
  13 +
19 14 @classmethod
20 15 def setUpClass(cls):
21 16 #获取session
22   - cls.se=ll.get_session("sg_wenze", "111111")
  17 + pass
23 18  
24 19 def setUp(self):
25 20 pass
26 21  
27 22 def test_01_fieldConfig(self):
28   - #成功查询上下游企业,无过滤条件
29 23 pass
30 24  
31 25 def tearDown(self):
32   - print("tearDown")
  26 + pass
33 27  
34 28 @classmethod
35 29 def tearDownClass(cls):
36   - cls.se.close()
  30 + pass
37 31  
38 32  
39 33  
... ...
src/testcase/login/test_login.py
... ... @@ -3,40 +3,45 @@
3 3 import unittest
4 4 import json
5 5 import urllib3
6   -from commons import ConfigDB as db
7   -from commons import common as com
8 6 from commons.api.login import login
9   -from commons.api.upStream import upStream
10   -from commons.MyRequest import myrequest
11 7 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
12 8 ll=login()
13   -uu=upStream()
14   -my=myrequest()
  9 +
15 10  
16 11  
17 12 class test_login(unittest.TestCase):
18   - '''分别封装各个接口和数据,数据处理过程写入代码'''
  13 +
19 14 @classmethod
20 15 def setUpClass(cls):
21   - #获取session
22   - cls.se=ll.get_session("sg_wenze", "111111")
23   -
  16 + pass
  17 +
24 18 def setUp(self):
25 19 pass
26 20  
27 21 def test_01_login(self):
28   - #成功查询上下游企业,无过滤条件
29   - pass
  22 + #账户密码都正确
  23 + re=ll.post("sg_wenze", "111111")
  24 +# print(re.headers)
  25 + self.assertTrue("Set-Cookie" in re.headers.keys())
  26 +
  27 + def test_02_login(self):
  28 + #密码错误
  29 + re=ll.post("sg_wenze", "111111111111")
  30 +# print(re.text)
  31 + self.assertTrue("用户名或密码错误" in re.text)
  32 +
  33 + def test_03_login(self):
  34 + #账户错误
  35 + re=ll.post("sg_wenze11111111", "11111")
  36 +# print(re.text)
  37 + self.assertTrue("用户名或密码错误" in re.text)
30 38  
31 39 def tearDown(self):
32   - print("tearDown")
  40 + pass
33 41  
34 42 @classmethod
35 43 def tearDownClass(cls):
36   - cls.se.close()
37   -
38   -
39   -
  44 + pass
40 45  
41 46  
42 47 if __name__ == "__main__":
... ...
src/testcase/upStream/test_upStream.py
... ... @@ -3,103 +3,69 @@
3 3 import unittest
4 4 import json
5 5 import urllib3
6   -from commons import ConfigDB as db
7   -from commons import common as com
8 6 from commons.api.login import login
9 7 from commons.api.upStream import upStream
10   -from commons.MyRequest import myrequest
11 8 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
12 9 ll=login()
13 10 uu=upStream()
14   -my=myrequest()
15 11  
16 12 #列表查询
17 13 class test_upStream1(unittest.TestCase):
18   -
  14 +
19 15 @classmethod
20 16 def setUpClass(cls):
21 17 #新增登记单
22   - cls.se=ll.get_session("user01")
  18 + cls.se=ll.get_session("user01",allow_redirects=False)
23 19  
24 20 def setUp(self):
25 21 pass
26 22  
27 23 def test_01_upStream1(self):
28 24 #成功查询上下游企业,无过滤条件
29   - re=self.se.post(url=uu.url,headers=uu.header,json=uu.body)
  25 + re=self.se.post(url=uu.url,headers=uu.header,json=uu.body,proxies={'http': 'http://localhost:8888', 'https': 'http://localhost:8888'})
30 26 print(re.json())
31 27 self.assertEqual(re.status_code, 200)
32   -
  28 + self.assertTrue("total" in re.json().keys())
  29 + self.assertTrue("上游" in str(re.json()).replace(" ",""))
  30 +
33 31 def test_02_upStream1(self):
34 32 #成功查询上下游企业,加入企业/个人名称过滤条件
35 33 body=uu.body.copy()
36 34 body["likeName"]="111"
37   - re=self.se.post(url=uu.url,headers=uu.header,json=uu.body)
  35 + re=self.se.post(url=uu.url,headers=uu.header,json=body,proxies={'http': 'http://localhost:8888', 'https': 'http://localhost:8888'})
38 36 print(re.json())
39 37 self.assertEqual(re.status_code, 200)
  38 + self.assertTrue("legalPerson':'哈哈哈'" in str(re.json()).replace(" ",""))
40 39  
41   -# def test_03_upStream1(self):
42   -# #成功查询上下游企业,加入业户名称名称过滤条件---使用不同的用户来调用接口
43   -# re=uu.post("user01",url=uu.url,headers=uu.header,json=uu.body)
44   -# print("test_03_upStream",re.json())
45   -# print(re.json())
46   -# self.assertEqual(re.status_code, 200)
  40 + def tearDown(self):
  41 + pass
  42 +
  43 + @classmethod
  44 + def tearDownClass(cls):
  45 + cls.se.close()
47 46  
48 47  
49 48 class test_upStream2(unittest.TestCase):
50   -
51   - @classmethod
52   - def setUpClass(cls):
53   - pass
54 49  
55   - def setUp(self):
56   - pass
57   -
58 50 def test_01_upStream2(self):
59   - #成功查询上下游企业,无过滤条件
60   - re=uu.post(url=uu.url,headers=uu.header,json=uu.body)
61   - print(re.json())
62   - self.assertEqual(re.status_code, 200)
63   -
64   - def test_02_upStream2(self):
65 51 #成功查询上下游企业,加入企业/个人名称过滤条件
66 52 body=uu.body.copy()
67 53 body["likeName"]="111"
68   - re=uu.post("sg_wenze", "111111",url=uu.url,headers=uu.header,json=body)
  54 + re=uu.post("user01",url=uu.url,headers=uu.header,json=body)
69 55 print(re.json())
70 56 self.assertEqual(re.status_code, 200)
  57 + self.assertTrue("legalPerson':'哈哈哈'" in str(re.json()).replace(" ",""))
71 58  
72   - def test_03_upStream2(self):
  59 + def test_02_upStream2(self):
73 60 #成功查询上下游企业,加入业户名称名称过滤条件
74 61 body=uu.body.copy()
75 62 body["likeUserName"]="地利人和"
76   - re=uu.post("sg_wenze", "111111",url=uu.url,headers=uu.header,json=body)
  63 + re=uu.post("user01",url=uu.url,headers=uu.header,json=body)
77 64 print(re.json())
78 65 self.assertEqual(re.status_code, 200)
  66 + self.assertTrue("userNames':'地利人和'" in str(re.json()).replace(" ",""))
79 67  
80 68  
81   -# def test_04_upStream2(self):
82   -# #成功查询上下游企业,加入业户名称名称过滤条件---实验直接传session给接口类使用(封装使用)
83   -# re=uu.post2(self.se,"user01",url=uu.url,headers=uu.header,json=uu.body)
84   -# print("test_03_upStream",re.json())
85   -# print(re.json())
86   -# self.assertEqual(re.status_code, 200)
87   -#
88   -# def test_05_upStream2(self):
89   -# #成功查询上下游企业,加入业户名称名称过滤条件
90   -# #使用公共的请求方法,数据需要单独维护
91   -# re=my.post2(self.se,"test_01_upStream")
92   -# print("test_04_upStream",re.json())
93   -# self.assertEqual(re.status_code, 200)
94   -
95   - def tearDown(self):
96   - print("tearDown")
97   -
98   - @classmethod
99   - def tearDownClass(cls):
100   - cls.se.close()
101   -
102   -
103 69 if __name__ == "__main__":
104 70 #unittest.main()方法会搜索该模块文件下所有以test开头的测试用例方法,并自动执行它们。
105 71 #如果不加下面这个语句,那么在通过unittest的方法添加测试用例时,这个文件里面的用例不会被搜索到。
... ... @@ -109,7 +75,7 @@ if __name__ == "__main__":
109 75 # # 以下代码可以调试单个测试用例,用例中打印的语句不会展示到控制台,使用前需要注释上面的代码unittest.main(),如果不使用下面代码,
110 76 # # 在有unittest.main()的情况下点击ctrl+f11,会直接运行当前页面所有用例,并且把用例用有打印的语句显示到控制台
111 77 current_suite = unittest.TestSuite()
112   - current_suite.addTest(test_upStream1("test_01_upStream1"))
  78 + current_suite.addTest(test_upStream2("test_01_upStream2"))
113 79 # #以列表形式添加多个测试用例
114 80 # # current_suite.addTests([submitOrder_With_Coupon("test_01"),submitOrder_With_Coupon("test_02")])
115 81 # # 执行测试
... ...