forked from orbit-oss/flask
Split up testsuite and moved it to flask.testsuite. This fixes #246
This commit is contained in:
parent
85ed1bf058
commit
4cb6eea8f1
42 changed files with 2575 additions and 2336 deletions
7
flask/testsuite/test_apps/blueprintapp/__init__.py
Normal file
7
flask/testsuite/test_apps/blueprintapp/__init__.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from flask import Flask
|
||||
|
||||
app = Flask(__name__)
|
||||
from blueprintapp.apps.admin import admin
|
||||
from blueprintapp.apps.frontend import frontend
|
||||
app.register_blueprint(admin)
|
||||
app.register_blueprint(frontend)
|
||||
0
flask/testsuite/test_apps/blueprintapp/apps/__init__.py
Normal file
0
flask/testsuite/test_apps/blueprintapp/apps/__init__.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from flask import Blueprint, render_template
|
||||
|
||||
admin = Blueprint('admin', __name__, url_prefix='/admin',
|
||||
template_folder='templates',
|
||||
static_folder='static')
|
||||
|
||||
|
||||
@admin.route('/')
|
||||
def index():
|
||||
return render_template('admin/index.html')
|
||||
|
||||
|
||||
@admin.route('/index2')
|
||||
def index2():
|
||||
return render_template('./admin/index.html')
|
||||
|
|
@ -0,0 +1 @@
|
|||
/* nested file */
|
||||
|
|
@ -0,0 +1 @@
|
|||
Admin File
|
||||
|
|
@ -0,0 +1 @@
|
|||
Hello from the Admin
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
from flask import Blueprint, render_template
|
||||
|
||||
frontend = Blueprint('frontend', __name__, template_folder='templates')
|
||||
|
||||
|
||||
@frontend.route('/')
|
||||
def index():
|
||||
return render_template('frontend/index.html')
|
||||
|
|
@ -0,0 +1 @@
|
|||
Hello from the Frontend
|
||||
4
flask/testsuite/test_apps/config_module_app.py
Normal file
4
flask/testsuite/test_apps/config_module_app.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
import os
|
||||
import flask
|
||||
here = os.path.abspath(os.path.dirname(__file__))
|
||||
app = flask.Flask(__name__)
|
||||
4
flask/testsuite/test_apps/config_package_app/__init__.py
Normal file
4
flask/testsuite/test_apps/config_package_app/__init__.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
import os
|
||||
import flask
|
||||
here = os.path.abspath(os.path.dirname(__file__))
|
||||
app = flask.Flask(__name__)
|
||||
7
flask/testsuite/test_apps/moduleapp/__init__.py
Normal file
7
flask/testsuite/test_apps/moduleapp/__init__.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from flask import Flask
|
||||
|
||||
app = Flask(__name__)
|
||||
from moduleapp.apps.admin import admin
|
||||
from moduleapp.apps.frontend import frontend
|
||||
app.register_module(admin)
|
||||
app.register_module(frontend)
|
||||
0
flask/testsuite/test_apps/moduleapp/apps/__init__.py
Normal file
0
flask/testsuite/test_apps/moduleapp/apps/__init__.py
Normal file
14
flask/testsuite/test_apps/moduleapp/apps/admin/__init__.py
Normal file
14
flask/testsuite/test_apps/moduleapp/apps/admin/__init__.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
from flask import Module, render_template
|
||||
|
||||
|
||||
admin = Module(__name__, url_prefix='/admin')
|
||||
|
||||
|
||||
@admin.route('/')
|
||||
def index():
|
||||
return render_template('admin/index.html')
|
||||
|
||||
|
||||
@admin.route('/index2')
|
||||
def index2():
|
||||
return render_template('./admin/index.html')
|
||||
|
|
@ -0,0 +1 @@
|
|||
/* nested file */
|
||||
|
|
@ -0,0 +1 @@
|
|||
Admin File
|
||||
|
|
@ -0,0 +1 @@
|
|||
Hello from the Admin
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
from flask import Module, render_template
|
||||
|
||||
|
||||
frontend = Module(__name__)
|
||||
|
||||
|
||||
@frontend.route('/')
|
||||
def index():
|
||||
return render_template('frontend/index.html')
|
||||
|
|
@ -0,0 +1 @@
|
|||
Hello from the Frontend
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
from flask import Module
|
||||
|
||||
|
||||
mod = Module(__name__, 'foo', subdomain='foo')
|
||||
|
|
@ -0,0 +1 @@
|
|||
Hello Subdomain
|
||||
Loading…
Add table
Add a link
Reference in a new issue