Skip to content

Commit 854a61d

Browse files
Further fix after review
1 parent 3ef267e commit 854a61d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

tests/sq_api_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ 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",

tests/test_api.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff 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+
mock = 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,

0 commit comments

Comments
 (0)