Moves largerapp into patterns dir and add test
- also adds this pattern into tox for testing
This commit is contained in:
parent
949771adf5
commit
92fa444259
9 changed files with 13 additions and 0 deletions
10
examples/patterns/largerapp/setup.py
Normal file
10
examples/patterns/largerapp/setup.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name='yourapplication',
|
||||
packages=['yourapplication'],
|
||||
include_package_data=True,
|
||||
install_requires=[
|
||||
'flask',
|
||||
],
|
||||
)
|
||||
12
examples/patterns/largerapp/tests/test_largerapp.py
Normal file
12
examples/patterns/largerapp/tests/test_largerapp.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
from yourapplication import app
|
||||
import pytest
|
||||
|
||||
@pytest.fixture
|
||||
def client(request):
|
||||
app.config['TESTING'] = True
|
||||
client = app.test_client()
|
||||
return client
|
||||
|
||||
def test_index(client):
|
||||
rv = client.get('/')
|
||||
assert b"Hello World!" in rv.data
|
||||
4
examples/patterns/largerapp/yourapplication/__init__.py
Normal file
4
examples/patterns/largerapp/yourapplication/__init__.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
from flask import Flask
|
||||
app = Flask(__name__)
|
||||
|
||||
import yourapplication.views
|
||||
5
examples/patterns/largerapp/yourapplication/views.py
Normal file
5
examples/patterns/largerapp/yourapplication/views.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
from yourapplication import app
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return 'Hello World!'
|
||||
Loading…
Add table
Add a link
Reference in a new issue