22import requests
33
44
5- def test_invalid_param_value (requester , params_location ):
5+ def test_invalid_param_value (requester , params_location , err_400 ):
66 params_invalid_param_value = params_location | {"locationCode" : "XYZ123" }
7- with pytest .raises (requests .HTTPError , match = r"API Error 127" ):
7+ with pytest .raises (requests .HTTPError , match = err_400 ):
88 requester .getArchivefile (params_invalid_param_value )
99
1010
@@ -14,18 +14,18 @@ def test_invalid_params_missing_required(requester, params_location):
1414 requester .getArchivefile (params_location )
1515
1616
17- def test_invalid_param_name (requester , params_location ):
17+ def test_invalid_param_name (requester , params_location , err_400 ):
1818 params_invalid_param_name = params_location | {"locationCodes" : "NCBC" }
19- with pytest .raises (requests .HTTPError , match = r"API Error 129" ):
19+ with pytest .raises (requests .HTTPError , match = err_400 ):
2020 requester .getArchivefile (params_invalid_param_name )
2121
2222
23- def test_no_data (requester , params_location ):
23+ def test_no_data (requester , params_location , err_400 ):
2424 params_no_data = params_location | {
2525 "dateFrom" : "2000-01-01" ,
2626 "dateTo" : "2000-01-02" ,
2727 }
28- with pytest .raises (requests .HTTPError , match = r"API Error 127" ):
28+ with pytest .raises (requests .HTTPError , match = err_400 ):
2929 requester .getArchivefile (params_no_data )
3030
3131
0 commit comments