@@ -123,21 +123,23 @@ def tearDown(self):
123123
124124
125125@pytest .mark .parametrize (
126- "query_params" ,
126+ "query_params,expected_status " ,
127127 [
128- {"source" : "csbs" },
129- {"source" : "jhu" },
130- {"timelines" : True },
131- {"timelines" : "true" },
132- {"timelines" : 1 },
133- {"source" : "jhu" , "timelines" : True },
128+ ({"source" : "csbs" }, 200 ),
129+ ({"source" : "jhu" }, 200 ),
130+ ({"timelines" : True }, 200 ),
131+ ({"timelines" : "true" }, 200 ),
132+ ({"timelines" : 1 }, 200 ),
133+ ({"source" : "jhu" , "timelines" : True }, 200 ),
134+ ({"source" : "csbs" , "country_code" : "US" }, 200 ),
135+ ({"source" : "jhu" , "country_code" : "US" }, 404 )
134136 ],
135137)
136- def test_locations_status_code (api_client , query_params ):
138+ def test_locations_status_code (api_client , query_params , expected_status ):
137139 response = api_client .get ("/v2/locations" , params = query_params )
138140 print (f"GET { response .url } \n { response } " )
139- assert response .status_code == 200
140-
141+ print ( f" \t json: \n { pf ( response .json ())[: 1000 ] } \n \t ..." )
142+ assert response . status_code == expected_status
141143
142144@pytest .mark .parametrize (
143145 "query_params" ,
0 commit comments