Skip to content

feat: added Client.check_switchers for smoke testing (local)#37

Merged
petruki merged 1 commit intomasterfrom
staging
Mar 7, 2026
Merged

feat: added Client.check_switchers for smoke testing (local)#37
petruki merged 1 commit intomasterfrom
staging

Conversation

@petruki
Copy link
Member

@petruki petruki commented Mar 7, 2026

This pull request introduces support for local switcher validation in addition to remote validation, enhancing the flexibility of the Client.check_switchers method. It adds a new LocalSwitcherError exception 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:

  • Added check_switchers function in snapshot_loader.py to verify switcher keys in a local snapshot, raising LocalSwitcherError if any are missing. (switcher_client/lib/snapshot_loader.py, switcher_client/lib/snapshot_loader.pyR61-R77)
  • Introduced LocalSwitcherError exception for missing local switchers and updated the error exports. (switcher_client/errors/__init__.py, [1] [2]

Client logic changes:

  • Modified Client.check_switchers to call local validation when running in local mode, otherwise defaulting to remote validation. (switcher_client/client.py, switcher_client/client.pyR174-R176)
  • Updated imports to include check_switchers and LocalSwitcherError. (switcher_client/client.py, [1]; switcher_client/lib/snapshot_loader.py, [2]

Testing:

  • Added and updated tests in test_client_check_switchers.py to cover local switcher validation, including scenarios for missing switchers and no snapshot loaded. (tests/test_client_check_switchers.py, [1] [2]

@petruki petruki self-assigned this Mar 7, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 7, 2026

@petruki petruki merged commit 0e2157c into master Mar 7, 2026
15 checks passed
@petruki petruki deleted the staging branch March 7, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant