Exemple #1
0
 def test_blueprints_registered(self, mock_register_blueprint):
     # Check the blueprint is registered during app creation.
     get_app(__name__)
     # We should only call this once as we only have one blueprint,
     mock_register_blueprint.assert_called_once()
     # and that blueprint is DIAGNOSTICS.
     mock_register_blueprint.assert_called_with(DIAGNOSTICS)
Exemple #2
0
 def test_apscheduler_invoked(self, mock_apscheduler):
     # Check APScheduler object is instantiated and api_enabled attribute
     # is True.
     get_app(__name__)
     self.assertTrue(mock_apscheduler.api_enabled)
Exemple #3
0
 def test_returns_flask_app(self):
     # Check a flask app is returned by get_app.
     app = get_app(__name__)
     self.assertIsInstance(app, Flask)
Exemple #4
0
 def test_returns_flask_app_with_gateway_exception(self, mock_provision):
     mock_provision.side_effect = ECCMalfunctionException("Gateway exited"
                                                          " with non-zero"
                                                          " code")
     app = get_app(__name__)
     self.assertIsInstance(app, Flask)
Exemple #5
0
from hw_diag.app import get_app

wsgi_app = get_app(__name__)