rpi-rgb/app/__init__.py
Finn Christiansen f7ede63681
Some checks failed
CSS Linter / CSS-Lint (push) Failing after 23s
Javascript Linter / Javascript-Lint (push) Successful in 10s
Python formatting PEP8 / Pyhton-PEP8 (push) Successful in 13s
introduce blueprints and unit tests
2023-06-05 22:33:36 +02:00

23 lines
608 B
Python

from flask import Flask
from config import config
app = Flask(__name__)
def create_app(config_name):
app = Flask(__name__)
from .index import index_blueprint
from .color import color_blueprint
app.register_blueprint(index_blueprint)
app.register_blueprint(color_blueprint)
app.config.from_object(config[config_name])
config[config_name].init_app(app)
@app.cli.command()
def test():
"""Run the unit tests."""
import unittest
tests = unittest.TestLoader().discover('tests')
unittest.TextTestRunner(verbosity=2).run(tests)
return app