Skip to content

feat: added Client.assume for is_on Switcher evaluation#50

Merged
petruki merged 1 commit intomasterfrom
staging
Apr 26, 2026
Merged

feat: added Client.assume for is_on Switcher evaluation#50
petruki merged 1 commit intomasterfrom
staging

Conversation

@petruki
Copy link
Copy Markdown
Member

@petruki petruki commented Apr 26, 2026

This pull request introduces a new "Bypasser" feature that allows developers to force switcher values for testing or stubbing purposes. The main changes add the ability to assume (force) or forget (remove) a value for a given switcher key, integrate this logic into the switcher evaluation flow, and provide tests for the new functionality.

Bypasser feature implementation:

  • Added the Bypasser class and Key class, which allow forcing a switcher value and retrieving or removing forced values (switcher_client/lib/bypasser/bypasser.py, switcher_client/lib/bypasser/key.py, switcher_client/lib/bypasser/__init__.py) [1] [2] [3].
  • Exposed assume and forget methods in the Client class to set or remove forced values for switchers (switcher_client/client.py).
  • Updated the switcher evaluation logic in Switcher.is_on() to return the forced value if present (switcher_client/switcher.py).

Testing:

  • Added a test suite to verify that forced switcher values override normal evaluation (tests/test_switcher_stub.py).

Imports and integration:

  • Updated imports in client.py and switcher.py to include the new Bypasser module (switcher_client/client.py, switcher_client/switcher.py) [1] [2].

@petruki petruki added this to the v1.0.0 milestone Apr 26, 2026
@petruki petruki self-assigned this Apr 26, 2026
@petruki petruki added the enhancement New feature or request label Apr 26, 2026
@sonarqubecloud
Copy link
Copy Markdown

@petruki petruki merged commit c8abbd8 into master Apr 26, 2026
15 checks passed
@petruki petruki deleted the staging branch April 26, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant