mirror of
https://github.com/vale981/flask-semanticui
synced 2025-03-04 16:51:39 -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
|
language: python
|
||||||
python:
|
python: 3.6
|
||||||
- "3.6"
|
install:
|
||||||
install: pip install .
|
- pip install .
|
||||||
|
- pip install -r requirements.txt
|
||||||
|
script: pytest
|
||||||
sudo: false
|
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'],
|
packages=['flask_semanticui'],
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'Flask>=1.0',
|
'Flask>=1.0'
|
||||||
'flask_wtf>=0.14'
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
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