Skip to content

Commit 1a843ec

Browse files
committed
Add a test for HTML retrieval.
1 parent 8507827 commit 1a843ec

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ def readme():
4141
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
4242
'Topic :: Software Development :: Libraries :: Python Modules'
4343
],
44-
test_suite='tests.test_autodoc',
44+
test_suite='tests',
4545
)

tests/test_flask_get.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import unittest
2+
3+
from flask import Flask
4+
from flask.ext.autodoc import Autodoc
5+
6+
7+
class TestAutodocWithFlask(unittest.TestCase):
8+
def setUp(self):
9+
self.app = Flask(__name__)
10+
self.autodoc = Autodoc(self.app)
11+
12+
@self.app.route('/')
13+
@self.autodoc.doc()
14+
def index():
15+
"""Returns a hello world message"""
16+
return 'Hello World!'
17+
18+
self.client = self.app.test_client()
19+
20+
def test_html(self):
21+
@self.app.route('/docs')
22+
def html_docs():
23+
return self.autodoc.html()
24+
25+
response = self.client.get('/docs')
26+
self.assertEqual(response.status_code, 200)

0 commit comments

Comments
 (0)