fix: relative path destination local mode#47
Merged
NicoleMGomes merged 2 commits intomainfrom Apr 13, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
LocalDevClientBase.__init__and the_mock_file()helper indestination/__init__.pyresolved themocks/directory by navigating three levels up from__file__:This works in a source checkout (
src/sap_cloud_sdk/destination/→ three levels up → project root), but when the package is installed into a virtual environment it lands at.venv/lib/python3.x/site-packages/sap_cloud_sdk/destination/, making three levels up resolve to.venv/lib/python3.x/instead of the project root. As a resultget_instance_destination()silently returnsNone.Both locations now use
os.getcwd(), which always resolves to the directory the application is launched from, regardless of install location:Unit test fixtures that previously patched
os.path.abspathwere updated to patchos.getcwdinstead.Related Issue
Closes #46
Type of Change
Please check the relevant option:
How to Test
sap_cloud_sdkinstalled from a virtual environment (not a source checkout).mocks/destination.jsonat the project root with at least one destination entry._file_pathpoints to the project root andget_instance_destination()returns the expected destination.Alternatively, run the unit test suite:
Checklist
Before submitting your PR, please review and check the following:
Breaking Changes
None. The fix only affects the path resolution for local development mock files. Any project that already placed
mocks/destination.jsonat the project root and ran the application from that root will see identical behaviour.Additional Notes
The same
__file__-based pattern was present in two places —_local_client_base.pyand the_mock_file()helper indestination/__init__.py— both are fixed.