-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding option to disable iopipe plugin using env var * added readme note for disabling iopipe plugin using env var * addition to docstring for disabling iopipe * enabled config implementation changed as suggested * additional tests for enabling/disabling iopipe
- Loading branch information
1 parent
a4159c0
commit f7917d3
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import os | ||
|
||
from iopipe.config import set_config | ||
|
||
|
||
def test_set_config__iopipe_enabled__default(): | ||
config = set_config() | ||
assert config['enabled'] is True | ||
|
||
|
||
def test_set_config__iopipe_enabled__title_case_true(): | ||
os.environ['IOPIPE_ENABLED'] = 'True' | ||
|
||
config = set_config() | ||
assert config['enabled'] is True | ||
|
||
|
||
def test_set_config__iopipe_enabled__small_caps_true(): | ||
os.environ['IOPIPE_ENABLED'] = 'true' | ||
|
||
config = set_config() | ||
assert config['enabled'] is True | ||
|
||
|
||
def test_set_config__iopipe_enabled__title_case_false(): | ||
os.environ['IOPIPE_ENABLED'] = 'False' | ||
|
||
config = set_config() | ||
assert config['enabled'] is False | ||
|
||
|
||
def test_set_config__iopipe_enabled__small_caps_false(): | ||
os.environ['IOPIPE_ENABLED'] = 'false' | ||
|
||
config = set_config() | ||
assert config['enabled'] is False |