@@ -120,20 +120,23 @@ def tearDown(self):
120120
121121
122122@pytest .mark .parametrize (
123- "query_params" ,
123+ "query_params,expected_status " ,
124124 [
125- {"source" : "csbs" },
126- {"source" : "jhu" },
127- {"timelines" : True },
128- {"timelines" : "true" },
129- {"timelines" : 1 },
130- {"source" : "jhu" , "timelines" : True },
125+ ({"source" : "csbs" }, 200 ),
126+ ({"source" : "jhu" }, 200 ),
127+ ({"timelines" : True }, 200 ),
128+ ({"timelines" : "true" }, 200 ),
129+ ({"timelines" : 1 }, 200 ),
130+ ({"source" : "jhu" , "timelines" : True }, 200 ),
131+ ({"source" : "csbs" , "country_code" : "US" }, 200 ),
132+ ({"source" : "jhu" , "country_code" : "US" }, 404 ),
131133 ],
132134)
133- def test_locations_status_code (api_client , query_params ):
135+ def test_locations_status_code (api_client , query_params , expected_status ):
134136 response = api_client .get ("/v2/locations" , params = query_params )
135137 print (f"GET { response .url } \n { response } " )
136- assert response .status_code == 200
138+ print (f"\t json:\n { pf (response .json ())[:1000 ]} \n \t ..." )
139+ assert response .status_code == expected_status
137140
138141
139142@pytest .mark .parametrize (
0 commit comments