40:8f08809cc1ce
Anton Shestakov <av6@dwimlabs.net>, Sun, 19 Jun 2016 00:04:48 +0800
viewer: templates for 404 and 500 error pages

next change 41:8d6436a284d2
previous change 39:81920cb8753b

tests/test_viewer.py

Permissions: -rw-r--r--

Other formats: Feeds:
from mock import Mock
from tornado.testing import AsyncHTTPTestCase
from candolint.models import database, Project, Change, Check
from viewer import CandolintViewer
def setup_module():
database.init(':memory:')
database.connect()
database.create_tables([Project, Change, Check], safe=True)
database.init = Mock()
database.connect = Mock()
database.close = Mock()
class ViewerTestCase(AsyncHTTPTestCase):
def get_app(self):
return CandolintViewer()
def test_index(self):
response = self.fetch('/')
assert response.code == 200
def test_404(self):
response = self.fetch('/nobodyhere')
assert response.code == 404