13. log改进2
2024-02-16 本文已影响0人
薛东弗斯
# project > test_cases > test_case_optimize > test_case_optimize.py
import pytest
from api.api import mobile_query
from utils.read_test import base_data
url = base_data.read_ini()['host']['api_sit_url']
def test_mobile():
param = base_data.read_data()["mobile"]
result = mobile_query(param)
assert result.success is True
assert result.body['status'] == 0
assert result.body['msg'] == "ok"
assert result.body['result']["province"] == "浙江"
assert result.body['result']["city"] == "杭州"
assert result.body['result']["company"] == "中国移动"
assert result.body['result']["cardtype"] is None
assert result.body['result']["areacode"] == "0571"
#
if __name__ == '__main__':
pytest.main()
# project > config > setting.ini
[host]
api_sit_url = https://api.binstd.com