Add basic sanity test

This commit is contained in:
Matt Good
2013-11-06 09:00:05 -08:00
parent 6d8249160d
commit d5987410d1
5 changed files with 49 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
language: python
python: "2.7"
env:
- TOXENV=py26
- TOXENV=py27
- TOXENV=py33
install:
- pip install tox --use-mirrors
script: tox
+17
View File
@@ -0,0 +1,17 @@
from flask import Flask, render_template
from flask_debugtoolbar import DebugToolbarExtension
app = Flask('basic_app')
app.debug = True
app.config['SECRET_KEY'] = 'abc123'
# make sure these are printable in the config panel
app.config['BYTES_VALUE'] = b'\x00'
app.config['UNICODE_VALUE'] = u'\uffff'
toolbar = DebugToolbarExtension(app)
@app.route('/')
def index():
return render_template('basic_app.html')
+4
View File
@@ -0,0 +1,4 @@
<!doctype html>
<html>
<body>Hello world</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
def load_app(name):
app = __import__(name).app
app.config['TESTING'] = True
return app.test_client()
def test_basic_app():
app = load_app('basic_app')
index = app.get('/')
assert index.status_code == 200
assert b'<div id="flDebug"' in index.data
+8
View File
@@ -0,0 +1,8 @@
[tox]
envlist = py26,py27,py33
[testenv]
deps =
pytest
commands =
py.test