Commit da4eb8ff14ec06a5c41b0cbe9cc07e6a7e0cf1b9

Authored by Antoine Goutenoir
1 parent 1b635a08
Exists in master

Add more tests.

Showing 1 changed file with 31 additions and 0 deletions   Show diff stats
tests/test_config.py 0 → 100644
@@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
  1 +#! ../env/bin/python
  2 +# -*- coding: utf-8 -*-
  3 +from flaskr import create_app
  4 +
  5 +
  6 +class TestConfig:
  7 + def test_dev_config(self):
  8 + """ Tests if the development config loads correctly """
  9 +
  10 + app = create_app('flaskr.settings.DevConfig')
  11 +
  12 + assert app.config['DEBUG'] is True
  13 + assert app.config['SQLALCHEMY_DATABASE_URI'] == 'sqlite:///../database.db'
  14 + assert app.config['CACHE_TYPE'] == 'null'
  15 +
  16 + def test_test_config(self):
  17 + """ Tests if the test config loads correctly """
  18 +
  19 + app = create_app('flaskr.settings.TestConfig')
  20 +
  21 + assert app.config['DEBUG'] is True
  22 + assert app.config['SQLALCHEMY_ECHO'] is True
  23 + assert app.config['CACHE_TYPE'] == 'null'
  24 +
  25 + def test_prod_config(self):
  26 + """ Tests if the production config loads correctly """
  27 +
  28 + app = create_app('flaskr.settings.ProdConfig')
  29 +
  30 + assert app.config['SQLALCHEMY_DATABASE_URI'] == 'sqlite:///../database.db'
  31 + assert app.config['CACHE_TYPE'] == 'simple'