Download:
child 294:df33e25d8960
parent 292:7b640cb27fe2
293:085ce95c6d95
Anton Shestakov <av6@dwimlabs.net>, Mon, 18 Sep 2017 16:54:55 +0800
tests: shortcut for attrib check (it works quite well with pytest)

1 файлов изменено, 1 вставок(+), 2 удалений(-) [+]
tests/test_viewer.py file | annotate | diff | comparison | revisions
--- a/tests/test_viewer.py Mon Sep 18 15:45:42 2017 +0800
+++ b/tests/test_viewer.py Mon Sep 18 16:54:55 2017 +0800
@@ -181,8 +181,7 @@
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'
+ assert root.attrib.get('height') == '20'
text = [el.text for el in root.findall('./svg:g/svg:text', ns)]
assert text[::2] == ['lint', '1 error', '1 warning']