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.



This pull request introduces support for local switcher validation in addition to remote validation, enhancing the flexibility of the
Client.check_switchersmethod. It adds a newLocalSwitcherErrorexception and implements logic to check for switcher existence in local snapshots. Comprehensive tests are included to verify the new local validation behavior and error handling.Local switcher validation:
check_switchersfunction insnapshot_loader.pyto verify switcher keys in a local snapshot, raisingLocalSwitcherErrorif any are missing. (switcher_client/lib/snapshot_loader.py, switcher_client/lib/snapshot_loader.pyR61-R77)LocalSwitcherErrorexception for missing local switchers and updated the error exports. (switcher_client/errors/__init__.py, [1] [2]Client logic changes:
Client.check_switchersto call local validation when running in local mode, otherwise defaulting to remote validation. (switcher_client/client.py, switcher_client/client.pyR174-R176)check_switchersandLocalSwitcherError. (switcher_client/client.py, [1];switcher_client/lib/snapshot_loader.py, [2]Testing:
test_client_check_switchers.pyto cover local switcher validation, including scenarios for missing switchers and no snapshot loaded. (tests/test_client_check_switchers.py, [1] [2]