-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mock get_platform / add CHARMHELPERS_IN_UNITTEST
Patch osplatform.get_platform() to return "ubuntu" if the environment variable CHARMHELPERS_IN_UNITTEST is set to something truthy. This is to enable unit testing in classic charms on NON ubuntu systems (e.g. Debian bookworm) where the function is often called via a decorator that is evaluated at module load time and thus is very, very tricky to mock out, as it is often 'hit' during the test discovery phase.
- Loading branch information
1 parent
fb4c776
commit 9333fea
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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