Test passes.

Added test for silent flag; added import of errno so it passed.
This commit is contained in:
Aaron Kavlie 2011-03-14 10:41:22 -04:00
parent 5cc40f4728
commit fa9817778c
2 changed files with 3 additions and 1 deletions

View file

@ -14,6 +14,7 @@ from __future__ import with_statement
import imp
import os
import sys
import errno
from werkzeug import import_string

View file

@ -1310,7 +1310,7 @@ class ConfigTestCase(unittest.TestCase):
assert "'FOO_SETTINGS' is not set" in str(e)
else:
assert 0, 'expected exception'
not app.config.from_envvar('FOO_SETTINGS', silent=True)
assert not app.config.from_envvar('FOO_SETTINGS', silent=True)
os.environ = {'FOO_SETTINGS': 'flask_tests.py'}
assert app.config.from_envvar('FOO_SETTINGS')
@ -1329,6 +1329,7 @@ class ConfigTestCase(unittest.TestCase):
assert msg.endswith("missing.cfg'")
else:
assert 0, 'expected config'
assert not app.config.from_pyfile('missing.cfg', silent=True)
class SubdomainTestCase(unittest.TestCase):