Skip to content

Commit

Permalink
add test to confirm app.config.update(ordbok) works
Browse files Browse the repository at this point in the history
  • Loading branch information
eriktaubeneck committed May 11, 2015
1 parent 8ded94c commit e3ec207
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/base_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,18 @@ def setUp(self):
self.app = Flask(os.getcwd()) # fudged files think they are in cwd
self.ordbok = FlaskOrdbok(app=self.app)

@fudge.patch('six.moves.builtins.open')
def test_flask_config_update(self, fudged_open):
fudged_open.is_callable().calls(fake_file_factory(fudged_config_files))
self.ordbok.load()
self.app.config.update(self.ordbok)
self.assertEquals(self.app.config['ENVIRONMENT'], 'development')
self.assertEquals(self.app.config['SECRET_KEY'], 'keep out!')
self.assertTrue(self.app.config['DEBUG'])
self.assertEquals(self.app.config['SQLALCHEMY_DATABASE_URL'],
'sqlite:///tmp/database.db')
self.assertTrue(self.app.config['SQLALCHEMY_ECHO'])

@mock.patch.object(Flask, 'run')
def test_flask_reloader(self, fudged_flask_run):
self.ordbok.load()
Expand Down

0 comments on commit e3ec207

Please sign in to comment.