Skip to content

Commit 0bf2d9a

Browse files
committed
Add a test for HTML retrieval.
1 parent 9fbf6df commit 0bf2d9a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

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)