- Timestamp:
- Apr 22, 2019, 5:39:46 PM (8 years ago)
- Branches:
- debian/bullseye, master
- Children:
- 041e464
- Parents:
- 5e4cb73
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mapservice/codegen/templates/__init__test.mustache
r5e4cb73 rbe25db1 2 2 3 3 import connexion 4 from flask_cors import CORS 4 5 from flask_testing import TestCase 5 6 6 7 from {{packageName}}.encoder import JSONEncoder 7 8 9 from {{packageName}}.server_impl.database.Model import db, db_test_setup 8 10 9 11 class BaseTestCase(TestCase): 12 def create_app(self): 13 logging.getLogger('connexion.operation').setLevel('ERROR') 14 app = connexion.App(__name__, specification_dir='../openapi/') 15 application = app.app 16 CORS(application) 17 application.json_encoder = JSONEncoder 18 app.add_api('openapi.yaml') 10 19 11 def create_app(self): 12 logging.getLogger('connexion.operation').setLevel('ERROR') 13 app = connexion.App(__name__, specification_dir='../openapi/') 14 app.app.json_encoder = JSONEncoder 15 app.add_api('openapi.yaml') 16 return app.app 20 application.config.from_object('{{packageName}}.server_impl.Config.TestingConfig') 21 db.init_app(application) 22 application.app_context().push() 23 24 return application 25 26 def setUp(self): 27 db.drop_all() 28 db_test_setup() 29 30 def tearDown(self): 31 db.session.remove() 32 db.drop_all()
Note:
See TracChangeset
for help on using the changeset viewer.
