Last active
August 29, 2015 14:17
-
-
Save kadams54/916b10945a88fe3b9079 to your computer and use it in GitHub Desktop.
Testing with Switchboard
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
from switchboard.testutils import switches | |
@switches(my_switch=True) | |
def test_foo_switch_active(): | |
# Call some code which checks operator.is_active('my_switch'). | |
# Switch will be active. | |
foo() | |
# Assertions. | |
@switches(my_switch=False) | |
def test_foo_switch_inactive(): | |
# Call some code which checks operator.is_active('my_switch'). | |
# Switch will be inactive. | |
foo() | |
# Assertions. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment