File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,13 +80,16 @@ def mock_analysis_jres(
8080 self ,
8181 body : Optional [list [dict ]] = None ,
8282 status : int = 200 ,
83+ os_matcher : Optional [str ] = "linux" ,
84+ arch_matcher : Optional [str ] = "x86_64" ,
8385 ) -> responses .BaseResponse :
8486 return self .rsps .get (
8587 url = f"{ self .api_url } /analysis/jres" ,
8688 json = body ,
8789 status = status ,
8890 match = [
8991 matchers .header_matcher ({"Accept" : "application/json" }),
92+ matchers .query_param_matcher (utils .filter_none_values ({"os" : os_matcher , "arch" : arch_matcher })),
9093 ],
9194 )
9295
Original file line number Diff line number Diff line change @@ -317,12 +317,19 @@ def test_get_analysis_jres(self):
317317 ),
318318 ]
319319
320- with self .subTest ("get_analysis_jres works" ), sq_api_mocker () as mocker :
320+ with self .subTest ("get_analysis_jres works (linux) " ), sq_api_mocker () as mocker :
321321 mocker .mock_analysis_jres ([sq_api_utils .jre_to_dict (jre ) for jre in expected_jres ])
322322
323323 actual_jres = self .sq .get_analysis_jres (os = "linux" , arch = "x86_64" )
324324 self .assertEqual (actual_jres , expected_jres )
325325
326+ with self .subTest ("get_analysis_jres works (windows)" ), sq_api_mocker () as mocker :
327+ mocker .mock_analysis_jres (
328+ [sq_api_utils .jre_to_dict (jre ) for jre in expected_jres ], os_matcher = "windows" , arch_matcher = "x86"
329+ )
330+ actual_jres = self .sq .get_analysis_jres (os = "windows" , arch = "x86" )
331+ self .assertEqual (actual_jres , expected_jres )
332+
326333 with (
327334 self .subTest ("get_analysis_jres returns error" ),
328335 sq_api_mocker () as mocker ,
You can’t perform that action at this time.
0 commit comments