File tree Expand file tree Collapse file tree
src/brave_search_python_client Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import json
22import os
3+ import pathlib
34from typing import Any
45from urllib .parse import urljoin , urlparse
56
67import httpx
78from tenacity import AsyncRetrying , RetryError , stop_after_attempt , wait_fixed
8- import pathlib
99
1010from brave_search_python_client .constants import (
1111 BASE_URL ,
1212 DEFAULT_RETRY_WAIT_TIME ,
1313 MOCK_API_KEY ,
14- MOCK_DATA_PATH ,
1514 __version__ ,
1615)
1716
@@ -114,12 +113,11 @@ async def _get(
114113
115114 def _load_mock_data (self , search_type : SearchType ):
116115 """Helper method to load mock data for testing purposes."""
117- import importlib .resources
118-
116+
119117 # Get package root directory
120- package_root = pathlib .Path (__file__ ).parent . parent . parent
121- mock_path = package_root / MOCK_DATA_PATH / f" { search_type } .json"
122-
118+ package_root = pathlib .Path (__file__ ).parent
119+ mock_path = package_root / f"responses/mock_data/ { search_type } .json"
120+
123121 with open (mock_path ) as f :
124122 return json .load (f )
125123
You can’t perform that action at this time.
0 commit comments