美文网首页
13. log改进2

13. log改进2

作者: 薛东弗斯 | 来源:发表于2024-02-16 17:44 被阅读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
    

    相关文章

      网友评论

          本文标题:13. log改进2

          本文链接:https://www.haomeiwen.com/subject/mfxuadtx.html