--- a/tests/test_viewer.py Tue Jul 19 22:22:48 2016 +0800
+++ b/tests/test_viewer.py Tue Jul 19 22:25:24 2016 +0800
from datetime import datetime
+from xml.etree import ElementTree
from pytest import raises
from tornado.web import HTTPError
response = self.fetch('/nobodyhere')
assert response.code == 404
assert 'online linter' in response.body
+ response = self.fetch('/butt.cloud/cyber/wizard-attack/status.svg')
+ assert response.code == 404
+ assert 'online linter' in response.body
+ response = self.fetch('/example.com/alice/test-viewer/status.svg')
+ assert response.code == 200
+ root = ElementTree.fromstring(response.body)
+ ns = {'svg': 'http://www.w3.org/2000/svg'}
+ assert root.tag == '{http://www.w3.org/2000/svg}svg'
+ assert 'height' in root.attrib
+ assert root.attrib['height'] == '20'
+ text = [el.text for el in root.findall('./svg:g/svg:text', ns)]
+ assert text[::2] == ['lint', '1 error', '1 warning']