Browse Source

add tests for trim_namespace argument of app.config.get_namespace

pull/1213/head
defuz 10 years ago
parent
commit
5e8d503098
  1. 8
      tests/test_config.py

8
tests/test_config.py

@ -182,3 +182,11 @@ def test_get_namespace():
assert 2 == len(bar_options) assert 2 == len(bar_options)
assert 'bar stuff 1' == bar_options['STUFF_1'] assert 'bar stuff 1' == bar_options['STUFF_1']
assert 'bar stuff 2' == bar_options['STUFF_2'] assert 'bar stuff 2' == bar_options['STUFF_2']
foo_options = app.config.get_namespace('FOO_', trim_namespace=False)
assert 2 == len(foo_options)
assert 'foo option 1' == foo_options['foo_option_1']
assert 'foo option 2' == foo_options['foo_option_2']
bar_options = app.config.get_namespace('BAR_', lowercase=False, trim_namespace=False)
assert 2 == len(bar_options)
assert 'bar stuff 1' == bar_options['BAR_STUFF_1']
assert 'bar stuff 2' == bar_options['BAR_STUFF_2']

Loading…
Cancel
Save