source: src/mapservice/src-gen/openapi_server/test/__init__.py@ aa68798

debian/bullseye
Last change on this file since aa68798 was be25db1, checked in by Joachim Langenbach <joachim.langenbach@…>, 8 years ago

Improved adding Water UI in mapservice-webclient

  • Property mode set to 100644
File size: 804 bytes
Line 
1import logging
2
3import connexion
4from flask_cors import CORS
5from flask_testing import TestCase
6
7from openapi_server.encoder import JSONEncoder
8
9from openapi_server.server_impl.database.Model import db, db_test_setup
10
11class 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')
19
20 application.config.from_object('openapi_server.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 TracBrowser for help on using the repository browser.