mirror of
https://github.com/vale981/flask-semanticui
synced 2025-03-04 08:41:41 -05:00
tests & travis
This commit is contained in:
parent
57532babf6
commit
fa00841df6
5 changed files with 51 additions and 5 deletions
|
@ -1,5 +1,7 @@
|
|||
language: python
|
||||
python:
|
||||
- "3.6"
|
||||
install: pip install .
|
||||
python: 3.6
|
||||
install:
|
||||
- pip install .
|
||||
- pip install -r requirements.txt
|
||||
script: pytest
|
||||
sudo: false
|
3
requirements.txt
Normal file
3
requirements.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
flask-debug
|
||||
flask-wtf
|
||||
pytest
|
13
sample.py
Normal file
13
sample.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from flask import Flask
|
||||
from .flask_semanticui import SemanticUI
|
||||
|
||||
|
||||
def create_app():
|
||||
app = Flask(__name__)
|
||||
SemanticUI(app)
|
||||
|
||||
@app.route('/')
|
||||
def hello():
|
||||
return 'Hello, World!'
|
||||
|
||||
return app
|
3
setup.py
3
setup.py
|
@ -11,7 +11,6 @@ setup(
|
|||
packages=['flask_semanticui'],
|
||||
include_package_data=True,
|
||||
install_requires=[
|
||||
'Flask>=1.0',
|
||||
'flask_wtf>=0.14'
|
||||
'Flask>=1.0'
|
||||
]
|
||||
)
|
||||
|
|
29
test_sample.py
Normal file
29
test_sample.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def app():
|
||||
import sys
|
||||
sys.path.append('.')
|
||||
|
||||
from sample import create_app
|
||||
|
||||
app = create_app()
|
||||
app.debug = True
|
||||
app.testing = True
|
||||
|
||||
# manually add flask-debug
|
||||
from flask_debug import Debug
|
||||
Debug(app)
|
||||
|
||||
return app
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client(app):
|
||||
return app.test_client()
|
||||
|
||||
|
||||
def test_index(client):
|
||||
resp = client.get('/')
|
||||
assert resp.status_code == 200
|
Loading…
Add table
Reference in a new issue