53:ed7f35f52927
Anton Shestakov <av6@dwimlabs.net>, Thu, 23 Jun 2016 14:58:09 +0800
checker: try and catch exceptions from execute() and somewhat finish the job Exceptions coming from execute() are programming errors in checker.py, but jobs still need to tell that they are finished (and failed) to be processed by incoming.py.

next change 78:06a1f6536049
previous change 41:8d6436a284d2

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
assert 'online linter' in response.body
def test_404(self):
response = self.fetch('/nobodyhere')
assert response.code == 404
assert 'online linter' in response.body