Coverage for src\pncp\utils.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-07-22 20:17 -0300

1from typing import Any 

2 

3import httpx 

4 

5 

6def get_many(url: str, params: dict[str, Any] | None = None) -> list[dict[str, Any]]: 

7 with httpx.Client(timeout=10) as client: 

8 response = client.get(url, params=params) 

9 response.raise_for_status() 

10 return response.json() 

11 

12 

13def get_one(url: str, params: dict[str, Any] | None = None) -> dict[str, Any]: 

14 with httpx.Client(timeout=10) as client: 

15 response = client.get(url, params=params) 

16 response.raise_for_status() 

17 return response.json()