Skip to content

Instantly share code, notes, and snippets.

@kadams54
Last active August 29, 2015 14:17
Show Gist options
  • Save kadams54/916b10945a88fe3b9079 to your computer and use it in GitHub Desktop.
Save kadams54/916b10945a88fe3b9079 to your computer and use it in GitHub Desktop.
Testing with Switchboard
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