Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
7 changes: 2 additions & 5 deletions src/sap_cloud_sdk/destination/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,8 @@


def _mock_file(name: str) -> str:
"""Return the absolute path to a mocks/<name> 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/<name> file relative to the working directory."""
return os.path.join(os.getcwd(), "mocks", name)


def create_client(
Expand Down
6 changes: 1 addition & 5 deletions src/sap_cloud_sdk/destination/_local_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions tests/destination/unit/test_local_certificate_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions tests/destination/unit/test_local_destination_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions tests/destination/unit/test_local_fragment_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Loading