Skip to content

Commit

Permalink
#3 add test for env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
hjacobs committed Dec 9, 2015
1 parent 71a7efe commit 921e09c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ junit.xml
dist/
build/
htmlcov/
.cache

# Vi
*.sw*
8 changes: 8 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import stups_cli.config


Expand All @@ -11,3 +12,10 @@ def test_store_load_config():
stups_cli.config.store_config(cfg, 'foobar')
new_cfg = stups_cli.config.load_config('foobar')
assert cfg == new_cfg


def test_load_config_with_environment():
os.environ['EXAMPLE_PROJ_MY_KEY'] = 'some value'
cfg = stups_cli.config.load_config('example-proj')
assert cfg == {'my_key': 'some value'}

0 comments on commit 921e09c

Please sign in to comment.