# report.html

Report generated on 06-Nov-2023 at 10:04:28 by pytest-html v3.2.0

## Summary

36 tests ran in 5.86 seconds.

(Un)check the boxes to filter the results.

30 passed, 1 skipped, 6 failed, 0 errors, 0 expected failures, 0 unexpected passes, 0 rerun

## Results

Result | Test | Duration | Links
--- | --- | --- | ---
No results found. Try to check the filters
Failed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data0-expect_data0-None-None-None] | 0.54 |

self = <InterfaceAutoTest.test_case.test_laohuang.test_bpm_laohuang.TestBPM object at 0x11A63610>
db_fix = <InterfaceAutoTest.common.db.DB object at 0x11A4F270>
req_fix = <InterfaceAutoTest.requests_method.requests_method.RequestsMethod object at 0x11B07DD0>, case_url = 'http://120.46.172.186:8080/auth'
case_method = 'POST', case_mime = 'json', case_data = {'password': 'MTIzNDU2', 'username': 'admin'}
expect_data = {'account': 'admin', 'loginStatus': True, 'username': '超级管理'}, sql_type = None, sql_data = None, update_key = None
@pytest.mark.parametrize("case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key", ReadExcel("BPM-laohuang").get_data())
def test_bpm(self, db_fix, req_fix, case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key):
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data)
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data)
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句的类型是否为select|delete或者为delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data.get("delete"))
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data.get("select"))
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求
res = req_fix.request_all(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)
# 断言
try:
for key in expect_data:
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '超级管理' == '超级管理员'
E - 超级管理员
E ? -
E + 超级管理
InterfaceAutoTest\test_case\test_laohuang\test_bpm_laohuang.py:48: AssertionError
During handling of the above exception, another exception occurred:
self = <InterfaceAutoTest.test_case.test_laohuang.test_bpm_laohuang.TestBPM object at 0x11A63610>
db_fix = <InterfaceAutoTest.common.db.DB object at 0x11A4F270>
req_fix = <InterfaceAutoTest.requests_method.requests_method.RequestsMethod object at 0x11B07DD0>, case_url = 'http://120.46.172.186:8080/auth'
case_method = 'POST', case_mime = 'json', case_data = {'password': 'MTIzNDU2', 'username': 'admin'}
expect_data = {'account': 'admin', 'loginStatus': True, 'username': '超级管理'}, sql_type = None, sql_data = None, update_key = None
@pytest.mark.parametrize("case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key", ReadExcel("BPM-laohuang").get_data())
def test_bpm(self, db_fix, req_fix, case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key):
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data)
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data)
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句的类型是否为select|delete或者为delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data.get("delete"))
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data.get("select"))
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求
res = req_fix.request_all(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)
# 断言
try:
for key in expect_data:
assert expect_data[key] == res.json().get(key)
except:
log.error("断言失败"+"，用例数据为："+str(case_data)+",期望数据为："+str(expect_data)+",服务器返回的数据为："+res.text)
> raise AssertionError("断言失败")
E AssertionError: 断言失败
InterfaceAutoTest\test_case\test_laohuang\test_bpm_laohuang.py:51: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 黄总:test_bpm_laohuang.py:50 断言失败，用例数据为：{'password': 'MTIzNDU2', 'username': 'admin'},期望数据为：{'username': '超级管理', 'account': 'admin', 'loginStatus': True},服务器返回的数据为：{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE2OTkzMjI2NjMsImlhdCI6MTY5OTIzNjI2M30.ZBhcAeIFkRUckb47FRwQClwXsU18RQ_bE2_5kvjN192J1ONt0k7DBgIqssDJD2GbDhwteeQ0EUmQBvbTAynt7g","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}

Failed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/refresh-GET-None-None-expect_data10-None-None-None] | 0.11 |

self = <InterfaceAutoTest.test_case.test_laohuang.test_bpm_laohuang.TestBPM object at 0x11A63070>
db_fix = <InterfaceAutoTest.common.db.DB object at 0x11A4F270>
req_fix = <InterfaceAutoTest.requests_method.requests_method.RequestsMethod object at 0x11B07DD0>, case_url = 'http://120.46.172.186:8080/refresh'
case_method = 'GET', case_mime = None, case_data = None, expect_data = {'message': '刷新成功'}, sql_type = None, sql_data = None, update_key = None
@pytest.mark.parametrize("case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key", ReadExcel("BPM-laohuang").get_data())
def test_bpm(self, db_fix, req_fix, case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key):
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data)
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data)
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句的类型是否为select|delete或者为delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data.get("delete"))
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data.get("select"))
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求
res = req_fix.request_all(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)
# 断言
try:
for key in expect_data:
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '刷新成功' == None
E + where None = <built-in method get of dict object at 0x11D58C00>('message')
E + where <built-in method get of dict object at 0x11D58C00> = {'account': '', 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE2OTkzMjI2NjUsImlhdCI6MTY5OTIzNjI2NX0.L1lNANolKe3_hfQz-S9vHcPVq61sW7nbntNwiv7Yusu-MxuQAVjkFztrrMjDNQzI-i1zd0xlnDSJF-Z601OMLA', 'userAttrs': {}, ...}.get
E + where {'account': '', 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE2OTkzMjI2NjUsImlhdCI6MTY5OTIzNjI2NX0.L1lNANolKe3_hfQz-S9vHcPVq61sW7nbntNwiv7Yusu-MxuQAVjkFztrrMjDNQzI-i1zd0xlnDSJF-Z601OMLA', 'userAttrs': {}, ...} = <bound method Response.json of <Response [200]>>()
E + where <bound method Response.json of <Response [200]>> = <Response [200]>.json
InterfaceAutoTest\test_case\test_laohuang\test_bpm_laohuang.py:48: AssertionError
During handling of the above exception, another exception occurred:
self = <InterfaceAutoTest.test_case.test_laohuang.test_bpm_laohuang.TestBPM object at 0x11A63070>
db_fix = <InterfaceAutoTest.common.db.DB object at 0x11A4F270>
req_fix = <InterfaceAutoTest.requests_method.requests_method.RequestsMethod object at 0x11B07DD0>, case_url = 'http://120.46.172.186:8080/refresh'
case_method = 'GET', case_mime = None, case_data = None, expect_data = {'message': '刷新成功'}, sql_type = None, sql_data = None, update_key = None
@pytest.mark.parametrize("case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key", ReadExcel("BPM-laohuang").get_data())
def test_bpm(self, db_fix, req_fix, case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key):
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data)
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data)
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句的类型是否为select|delete或者为delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data.get("delete"))
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data.get("select"))
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求
res = req_fix.request_all(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)
# 断言
try:
for key in expect_data:
assert expect_data[key] == res.json().get(key)
except:
log.error("断言失败"+"，用例数据为："+str(case_data)+",期望数据为："+str(expect_data)+",服务器返回的数据为："+res.text)
> raise AssertionError("断言失败")
E AssertionError: 断言失败
InterfaceAutoTest\test_case\test_laohuang\test_bpm_laohuang.py:51: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 黄总:test_bpm_laohuang.py:50 断言失败，用例数据为：None,期望数据为：{'message': '刷新成功'},服务器返回的数据为：{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE2OTkzMjI2NjUsImlhdCI6MTY5OTIzNjI2NX0.L1lNANolKe3_hfQz-S9vHcPVq61sW7nbntNwiv7Yusu-MxuQAVjkFztrrMjDNQzI-i1zd0xlnDSJF-Z601OMLA","username":"","account":"","userId":"","loginStatus":true,"userAttrs":{}}

Failed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/api/demension/v1/dem/deleteDemByIds-DELETE-query-case_data16-expect_data16-select-SELECT ID_ from uc_demension WHERE `CODE_`="dem_test57_abc";-ids] | 0.10 |

self = <InterfaceAutoTest.test_case.test_laohuang.test_bpm_laohuang.TestBPM object at 0x11A59C70>
db_fix = <InterfaceAutoTest.common.db.DB object at 0x11A4F270>
req_fix = <InterfaceAutoTest.requests_method.requests_method.RequestsMethod object at 0x11B07DD0>
case_url = 'http://120.46.172.186:8080/api/demension/v1/dem/deleteDemByIds', case_method = 'DELETE', case_mime = 'query'
case_data = {'ids': '1721347774508711936'}, expect_data = {'message': '删除维度成功', 'state': True}, sql_type = 'select'
sql_data = 'SELECT ID_ from uc_demension WHERE `CODE_`="dem_test57_abc";', update_key = 'ids'
@pytest.mark.parametrize("case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key", ReadExcel("BPM-laohuang").get_data())
def test_bpm(self, db_fix, req_fix, case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key):
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data)
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data)
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句的类型是否为select|delete或者为delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data.get("delete"))
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data.get("select"))
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求
res = req_fix.request_all(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)
# 断言
try:
for key in expect_data:
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '删除维度成功' == '删除维度成功！'
E - 删除维度成功！
E ? -
E + 删除维度成功
InterfaceAutoTest\test_case\test_laohuang\test_bpm_laohuang.py:48: AssertionError
During handling of the above exception, another exception occurred:
self = <InterfaceAutoTest.test_case.test_laohuang.test_bpm_laohuang.TestBPM object at 0x11A59C70>
db_fix = <InterfaceAutoTest.common.db.DB object at 0x11A4F270>
req_fix = <InterfaceAutoTest.requests_method.requests_method.RequestsMethod object at 0x11B07DD0>
case_url = 'http://120.46.172.186:8080/api/demension/v1/dem/deleteDemByIds', case_method = 'DELETE', case_mime = 'query'
case_data = {'ids': '1721347774508711936'}, expect_data = {'message': '删除维度成功', 'state': True}, sql_type = 'select'
sql_data = 'SELECT ID_ from uc_demension WHERE `CODE_`="dem_test57_abc";', update_key = 'ids'
@pytest.mark.parametrize("case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key", ReadExcel("BPM-laohuang").get_data())
def test_bpm(self, db_fix, req_fix, case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key):
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data)
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data)
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句的类型是否为select|delete或者为delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data.get("delete"))
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data.get("select"))
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求
res = req_fix.request_all(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)
# 断言
try:
for key in expect_data:
assert expect_data[key] == res.json().get(key)
except:
log.error("断言失败"+"，用例数据为："+str(case_data)+",期望数据为："+str(expect_data)+",服务器返回的数据为："+res.text)
> raise AssertionError("断言失败")
E AssertionError: 断言失败
InterfaceAutoTest\test_case\test_laohuang\test_bpm_laohuang.py:51: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 黄总:test_bpm_laohuang.py:50 断言失败，用例数据为：{'ids': '1721347774508711936'},期望数据为：{'state': True, 'message': '删除维度成功'},服务器返回的数据为：{"state":true,"message":"删除维度成功！","value":""}

Failed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data0-expect_data0-None-None-None] | 0.48 |

self = <InterfaceAutoTest.test_case.test_zhangsan.test_bpm.TestBPM object at 0x11A4F390>
db_fix = <InterfaceAutoTest.common.db.DB object at 0x11DE0BB0>
req_fix = <InterfaceAutoTest.requests_method.requests_method.RequestsMethod object at 0x11DE0DB0>, case_url = 'http://120.46.172.186:8080/auth'
case_method = 'POST', case_mime = 'json', case_data = {'password': 'MTIzNDU2', 'username': 'admin'}
expect_data = {'account': 'admin', 'loginStatus': True, 'username': '超级管理'}, sql_type = None, sql_data = None, update_key = None
@pytest.mark.parametrize("case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key", ReadExcel("BPM", excel_path=excel_path).get_data())
def test_bpm(self, db_fix, req_fix, case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key):
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data)
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data)
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句的类型是否为select|delete或者为delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data.get("delete"))
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data.get("select"))
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求
res = req_fix.request_all(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)
# 断言
try:
for key in expect_data:
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '超级管理' == '超级管理员'
E - 超级管理员
E ? -
E + 超级管理
InterfaceAutoTest\test_case\test_zhangsan\test_bpm.py:51: AssertionError
During handling of the above exception, another exception occurred:
self = <InterfaceAutoTest.test_case.test_zhangsan.test_bpm.TestBPM object at 0x11A4F390>
db_fix = <InterfaceAutoTest.common.db.DB object at 0x11DE0BB0>
req_fix = <InterfaceAutoTest.requests_method.requests_method.RequestsMethod object at 0x11DE0DB0>, case_url = 'http://120.46.172.186:8080/auth'
case_method = 'POST', case_mime = 'json', case_data = {'password': 'MTIzNDU2', 'username': 'admin'}
expect_data = {'account': 'admin', 'loginStatus': True, 'username': '超级管理'}, sql_type = None, sql_data = None, update_key = None
@pytest.mark.parametrize("case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key", ReadExcel("BPM", excel_path=excel_path).get_data())
def test_bpm(self, db_fix, req_fix, case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key):
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data)
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data)
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句的类型是否为select|delete或者为delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data.get("delete"))
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data.get("select"))
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求
res = req_fix.request_all(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)
# 断言
try:
for key in expect_data:
assert expect_data[key] == res.json().get(key)
except:
log.error("断言失败"+"，用例数据为："+str(case_data)+",期望数据为："+str(expect_data)+",服务器返回的数据为："+res.text)
> raise AssertionError("断言失败")
E AssertionError: 断言失败
InterfaceAutoTest\test_case\test_zhangsan\test_bpm.py:54: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 黄总:test_bpm.py:53 断言失败，用例数据为：{'password': 'MTIzNDU2', 'username': 'admin'},期望数据为：{'username': '超级管理', 'account': 'admin', 'loginStatus': True},服务器返回的数据为：{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE2OTkzMjI2NjYsImlhdCI6MTY5OTIzNjI2Nn0.Tu_-StMCDXy30jGLhp1XpYHx9QwwWciPiKN_jrHDhHPtGlP9D2Yaa4xYzD7DGttGpf-nEYgd0lRFYGGMqRVN5A","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}

Failed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/refresh-GET-None-None-expect_data10-None-None-None] | 0.13 |

self = <InterfaceAutoTest.test_case.test_zhangsan.test_bpm.TestBPM object at 0x11A4FBD0>
db_fix = <InterfaceAutoTest.common.db.DB object at 0x11DE0BB0>
req_fix = <InterfaceAutoTest.requests_method.requests_method.RequestsMethod object at 0x11DE0DB0>, case_url = 'http://120.46.172.186:8080/refresh'
case_method = 'GET', case_mime = None, case_data = None, expect_data = {'message': '刷新成功'}, sql_type = None, sql_data = None, update_key = None
@pytest.mark.parametrize("case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key", ReadExcel("BPM", excel_path=excel_path).get_data())
def test_bpm(self, db_fix, req_fix, case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key):
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data)
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data)
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句的类型是否为select|delete或者为delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data.get("delete"))
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data.get("select"))
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求
res = req_fix.request_all(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)
# 断言
try:
for key in expect_data:
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '刷新成功' == None
E + where None = <built-in method get of dict object at 0x11DB8510>('message')
E + where <built-in method get of dict object at 0x11DB8510> = {'account': '', 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE2OTkzMjI2NjcsImlhdCI6MTY5OTIzNjI2N30.8rN3PmPJh6JTsfgQS17drha-EoddarcUabPEVN5kAGEq6PDcxbWTtXNN81b3TfZ1FYoZaaXpc5zmcLLPaPDNEQ', 'userAttrs': {}, ...}.get
E + where {'account': '', 'loginStatus': True, 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE2OTkzMjI2NjcsImlhdCI6MTY5OTIzNjI2N30.8rN3PmPJh6JTsfgQS17drha-EoddarcUabPEVN5kAGEq6PDcxbWTtXNN81b3TfZ1FYoZaaXpc5zmcLLPaPDNEQ', 'userAttrs': {}, ...} = <bound method Response.json of <Response [200]>>()
E + where <bound method Response.json of <Response [200]>> = <Response [200]>.json
InterfaceAutoTest\test_case\test_zhangsan\test_bpm.py:51: AssertionError
During handling of the above exception, another exception occurred:
self = <InterfaceAutoTest.test_case.test_zhangsan.test_bpm.TestBPM object at 0x11A4FBD0>
db_fix = <InterfaceAutoTest.common.db.DB object at 0x11DE0BB0>
req_fix = <InterfaceAutoTest.requests_method.requests_method.RequestsMethod object at 0x11DE0DB0>, case_url = 'http://120.46.172.186:8080/refresh'
case_method = 'GET', case_mime = None, case_data = None, expect_data = {'message': '刷新成功'}, sql_type = None, sql_data = None, update_key = None
@pytest.mark.parametrize("case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key", ReadExcel("BPM", excel_path=excel_path).get_data())
def test_bpm(self, db_fix, req_fix, case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key):
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data)
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data)
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句的类型是否为select|delete或者为delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data.get("delete"))
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data.get("select"))
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求
res = req_fix.request_all(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)
# 断言
try:
for key in expect_data:
assert expect_data[key] == res.json().get(key)
except:
log.error("断言失败"+"，用例数据为："+str(case_data)+",期望数据为："+str(expect_data)+",服务器返回的数据为："+res.text)
> raise AssertionError("断言失败")
E AssertionError: 断言失败
InterfaceAutoTest\test_case\test_zhangsan\test_bpm.py:54: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 黄总:test_bpm.py:53 断言失败，用例数据为：None,期望数据为：{'message': '刷新成功'},服务器返回的数据为：{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE2OTkzMjI2NjcsImlhdCI6MTY5OTIzNjI2N30.8rN3PmPJh6JTsfgQS17drha-EoddarcUabPEVN5kAGEq6PDcxbWTtXNN81b3TfZ1FYoZaaXpc5zmcLLPaPDNEQ","username":"","account":"","userId":"","loginStatus":true,"userAttrs":{}}

Failed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/api/demension/v1/dem/deleteDemByIds-DELETE-query-case_data16-expect_data16-select-SELECT ID_ from uc_demension WHERE `CODE_`="dem_test57_abc";-ids] | 0.11 |

self = <InterfaceAutoTest.test_case.test_zhangsan.test_bpm.TestBPM object at 0x11A4F830>
db_fix = <InterfaceAutoTest.common.db.DB object at 0x11DE0BB0>
req_fix = <InterfaceAutoTest.requests_method.requests_method.RequestsMethod object at 0x11DE0DB0>
case_url = 'http://120.46.172.186:8080/api/demension/v1/dem/deleteDemByIds', case_method = 'DELETE', case_mime = 'query'
case_data = {'ids': '1721347785455845376'}, expect_data = {'message': '删除维度成功', 'state': True}, sql_type = 'select'
sql_data = 'SELECT ID_ from uc_demension WHERE `CODE_`="dem_test57_abc";', update_key = 'ids'
@pytest.mark.parametrize("case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key", ReadExcel("BPM", excel_path=excel_path).get_data())
def test_bpm(self, db_fix, req_fix, case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key):
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data)
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data)
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句的类型是否为select|delete或者为delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data.get("delete"))
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data.get("select"))
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求
res = req_fix.request_all(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)
# 断言
try:
for key in expect_data:
> assert expect_data[key] == res.json().get(key)
E AssertionError: assert '删除维度成功' == '删除维度成功！'
E - 删除维度成功！
E ? -
E + 删除维度成功
InterfaceAutoTest\test_case\test_zhangsan\test_bpm.py:51: AssertionError
During handling of the above exception, another exception occurred:
self = <InterfaceAutoTest.test_case.test_zhangsan.test_bpm.TestBPM object at 0x11A4F830>
db_fix = <InterfaceAutoTest.common.db.DB object at 0x11DE0BB0>
req_fix = <InterfaceAutoTest.requests_method.requests_method.RequestsMethod object at 0x11DE0DB0>
case_url = 'http://120.46.172.186:8080/api/demension/v1/dem/deleteDemByIds', case_method = 'DELETE', case_mime = 'query'
case_data = {'ids': '1721347785455845376'}, expect_data = {'message': '删除维度成功', 'state': True}, sql_type = 'select'
sql_data = 'SELECT ID_ from uc_demension WHERE `CODE_`="dem_test57_abc";', update_key = 'ids'
@pytest.mark.parametrize("case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key", ReadExcel("BPM", excel_path=excel_path).get_data())
def test_bpm(self, db_fix, req_fix, case_url, case_method, case_mime, case_data, expect_data, sql_type, sql_data, update_key):
# 判断sql语句的类型是否为delete
if sql_type == "delete":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data)
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句类型是否为select
elif sql_type == "select":
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data)
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求--pass
# 判断sql语句的类型是否为select|delete或者为delete|select
elif sql_type == "select|delete" or sql_type == "delete|select":
# 使用DB类对象执行删除的sql语句
db_fix.delete(sql_data.get("delete"))
# 使用DB类对象执行查询的sql语句，并接收查询的结果
select_result = db_fix.select(sql_data.get("select"))
# 将查询结果更新到用例数据中
case_data[update_key] = select_result
# 使用RequestsMethod类对象发送请求
res = req_fix.request_all(req_method=case_method, req_url=case_url, req_mime=case_mime, case_data=case_data)
# 断言
try:
for key in expect_data:
assert expect_data[key] == res.json().get(key)
except:
log.error("断言失败"+"，用例数据为："+str(case_data)+",期望数据为："+str(expect_data)+",服务器返回的数据为："+res.text)
> raise AssertionError("断言失败")
E AssertionError: 断言失败
InterfaceAutoTest\test_case\test_zhangsan\test_bpm.py:54: AssertionError
-------------------------------Captured log call--------------------------------
ERROR 黄总:test_bpm.py:53 断言失败，用例数据为：{'ids': '1721347785455845376'},期望数据为：{'state': True, 'message': '删除维度成功'},服务器返回的数据为：{"state":true,"message":"删除维度成功！","value":""}

Skipped | test_order/test_pytest_func.py::Test01::test3 | 0.00 |
('C:\\Users\\86184\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages\\pytest_dependency.py', 103, 'Skipped: test3 depends on test1')
Passed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data1-expect_data1-None-None-None] | 0.05 |
No log output captured.
Passed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data2-expect_data2-None-None-None] | 0.10 |
No log output captured.
Passed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data3-expect_data3-None-None-None] | 0.10 |
No log output captured.
Passed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data4-expect_data4-None-None-None] | 0.10 |
No log output captured.
Passed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-application/json-case_data5-expect_data5-None-None-None] | 0.10 |
No log output captured.
Passed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-application/json-case_data6-expect_data6-None-None-None] | 0.11 |
No log output captured.
Passed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data7-expect_data7-None-None-None] | 0.11 |
No log output captured.
Passed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-application/json-case_data8-expect_data8-None-None-None] | 0.11 |
No log output captured.
Passed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data9-expect_data9-None-None-None] | 0.09 |
No log output captured.
Passed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/api/demension/v1/dem/addDem-post-json-case_data11-expect_data11-delete-DELETE FROM uc_demension WHERE `CODE_`="dem_test57_abc";-None] | 0.17 |
No log output captured.
Passed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/api/demension/v1/dem/getDem-GET-query-case_data12-expect_data12-None-None-None] | 0.07 |
No log output captured.
Passed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/api/org/v1/org/addOrg-POST-application/json-case_data13-expect_data13-select|delete-sql_data13-demId] | 0.19 |
No log output captured.
Passed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/api/org/v1/orgParam/saveOrgParams-POST-body|query-case_data14-expect_data14-None-None-None] | 0.07 |
No log output captured.
Passed | test_laohuang/test_bpm_laohuang.py::TestBPM::test_bpm[http://120.46.172.186:8080/api/org/v1/org/deleteOrg-POST-x-www-form-urlencoded-test_org_57-expect_data15-None-None-None] | 0.07 |
No log output captured.
Passed | test_order/test_pytest_func.py::Test01::test1 | 0.19 |

------------------------------Captured stdout call------------------------------
用例1 {"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInRlbmFudElkIjoiLTEiLCJleHAiOjE2OTkzMjI2NjUsImlhdCI6MTY5OTIzNjI2NX0.L1lNANolKe3_hfQz-S9vHcPVq61sW7nbntNwiv7Yusu-MxuQAVjkFztrrMjDNQzI-i1zd0xlnDSJF-Z601OMLA","username":"超级管理员","account":"admin","userId":"1","expiration":86400,"loginStatus":true,"userAttrs":{"tenantId":"-1"}}

Passed | test_order/test_pytest_func.py::Test01::test2 | 0.06 |
------------------------------Captured stdout call------------------------------ 添加维度用例 {"state":true,"message":"添加维度成功！","value":""}
Passed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data1-expect_data1-None-None-None] | 0.04 |
No log output captured.
Passed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data2-expect_data2-None-None-None] | 0.10 |
No log output captured.
Passed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data3-expect_data3-None-None-None] | 0.10 |
No log output captured.
Passed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data4-expect_data4-None-None-None] | 0.10 |
No log output captured.
Passed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-application/json-case_data5-expect_data5-None-None-None] | 0.11 |
No log output captured.
Passed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-application/json-case_data6-expect_data6-None-None-None] | 0.11 |
No log output captured.
Passed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data7-expect_data7-None-None-None] | 0.12 |
No log output captured.
Passed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-application/json-case_data8-expect_data8-None-None-None] | 0.11 |
No log output captured.
Passed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/auth-POST-json-case_data9-expect_data9-None-None-None] | 0.11 |
No log output captured.
Passed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/api/demension/v1/dem/addDem-post-json-case_data11-expect_data11-delete-DELETE FROM uc_demension WHERE `CODE_`="dem_test57_abc";-None] | 0.16 |
No log output captured.
Passed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/api/demension/v1/dem/getDem-GET-query-case_data12-expect_data12-None-None-None] | 0.06 |
No log output captured.
Passed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/api/org/v1/org/addOrg-POST-application/json-case_data13-expect_data13-select|delete-sql_data13-demId] | 0.25 |
No log output captured.
Passed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/api/org/v1/orgParam/saveOrgParams-POST-body|query-case_data14-expect_data14-None-None-None] | 0.09 |
No log output captured.
Passed | test_zhangsan/test_bpm.py::TestBPM::test_bpm[http://120.46.172.186:8080/api/org/v1/org/deleteOrg-POST-x-www-form-urlencoded-test_org_57-expect_data15-None-None-None] | 0.06 |
No log output captured.