--- a/tests/test_viewer.py Mon Aug 22 20:38:06 2016 +0800
+++ b/tests/test_viewer.py Mon Aug 22 23:05:40 2016 +0800
from xml.etree import ElementTree
from pytest import raises
+from tornado.escape import json_encode
+from tornado.testing import AsyncHTTPTestCase
from tornado.web import HTTPError
-from tornado.testing import AsyncHTTPTestCase
from candolint.handlers import get_project_or_404
from candolint.models import database, Project, Change, Check
message='component: do a thing',
+ 'text': '# C&O job started: 2016-08-20T02:38:06+00:00',
+ 'text': '# C&O task: setup',
+ 'text': '$ ../venv2/bin/flake8 --version',
+ 'text': '# C&O task: checks',
+ 'text': 'test.py:20:80: E501 line too long (82 > 79 characters)',
+ 'text': '# C&O job finished: 2016-08-20T02:38:53+00:00',
ordinal=Check.get_next_ordinal(project),
+ lines=json_encode(lines),
assert '1 error' in response.body
assert '1 warning' in response.body
assert '<a href="#">default</a>' in response.body
+ assert '<a href="#" class="filelink">test.py:20</a>' in response.body
response = self.fetch('/example.com/alice/test-viewer/latest/raw')
assert response.code == 200
assert response.headers['Content-Type'] == 'text/plain; charset=utf-8'
+ assert 'test.py' in response.body
response = self.fetch('/butt.cloud/cyber/wizard-attack/status.svg')