diff --git a/pyproject.toml b/pyproject.toml index b469140..5341fef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "sap-cloud-sdk" -version = "0.6.1" +version = "0.6.2" description = "SAP Cloud SDK for Python" readme = "README.md" license = "Apache-2.0" diff --git a/src/sap_cloud_sdk/destination/__init__.py b/src/sap_cloud_sdk/destination/__init__.py index 81ce282..1e6a537 100644 --- a/src/sap_cloud_sdk/destination/__init__.py +++ b/src/sap_cloud_sdk/destination/__init__.py @@ -70,11 +70,8 @@ def _mock_file(name: str) -> str: - """Return the absolute path to a mocks/ file relative to the repo root.""" - repo_root = os.path.abspath( - os.path.join(os.path.dirname(__file__), "..", "..", "..") - ) - return os.path.join(repo_root, "mocks", name) + """Return the absolute path to a mocks/ file relative to the working directory.""" + return os.path.join(os.getcwd(), "mocks", name) def create_client( diff --git a/src/sap_cloud_sdk/destination/_local_client_base.py b/src/sap_cloud_sdk/destination/_local_client_base.py index a4c44fc..b68d965 100644 --- a/src/sap_cloud_sdk/destination/_local_client_base.py +++ b/src/sap_cloud_sdk/destination/_local_client_base.py @@ -43,11 +43,7 @@ class LocalDevClientBase(ABC, Generic[T]): """ def __init__(self) -> None: - # Resolve to repo root and mocks path - repo_root = os.path.abspath( - os.path.join(os.path.dirname(__file__), "..", "..", "..") - ) - self._file_path = os.path.join(repo_root, "mocks", self.file_name) + self._file_path = os.path.join(os.getcwd(), "mocks", self.file_name) self._lock = threading.Lock() self._ensure_file() diff --git a/tests/destination/unit/test_local_certificate_client.py b/tests/destination/unit/test_local_certificate_client.py index f8859c8..14f0f1d 100644 --- a/tests/destination/unit/test_local_certificate_client.py +++ b/tests/destination/unit/test_local_certificate_client.py @@ -15,8 +15,8 @@ def client(tmp_path, monkeypatch): """Create a LocalDevCertificateClient backed by a temp directory.""" monkeypatch.setattr( - "sap_cloud_sdk.destination._local_client_base.os.path.abspath", - lambda _: str(tmp_path), + "sap_cloud_sdk.destination._local_client_base.os.getcwd", + lambda: str(tmp_path), ) return LocalDevCertificateClient() diff --git a/tests/destination/unit/test_local_destination_client.py b/tests/destination/unit/test_local_destination_client.py index 268a561..6b75890 100644 --- a/tests/destination/unit/test_local_destination_client.py +++ b/tests/destination/unit/test_local_destination_client.py @@ -15,8 +15,8 @@ def client(tmp_path, monkeypatch): """Create a LocalDevDestinationClient backed by a temp directory.""" monkeypatch.setattr( - "sap_cloud_sdk.destination._local_client_base.os.path.abspath", - lambda _: str(tmp_path), + "sap_cloud_sdk.destination._local_client_base.os.getcwd", + lambda: str(tmp_path), ) return LocalDevDestinationClient() diff --git a/tests/destination/unit/test_local_fragment_client.py b/tests/destination/unit/test_local_fragment_client.py index f017a84..0dc66fc 100644 --- a/tests/destination/unit/test_local_fragment_client.py +++ b/tests/destination/unit/test_local_fragment_client.py @@ -14,8 +14,8 @@ def client(tmp_path, monkeypatch): """Create a LocalDevFragmentClient backed by a temp directory.""" monkeypatch.setattr( - "sap_cloud_sdk.destination._local_client_base.os.path.abspath", - lambda _: str(tmp_path), + "sap_cloud_sdk.destination._local_client_base.os.getcwd", + lambda: str(tmp_path), ) return LocalDevFragmentClient()