Module: check_mk
Branch: master
Commit: b33602277d38030b108a04298c34ce1c41b1042d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b33602277d3803…
Author: Roland Halbig <rh(a)mathias-kettner.de>
Date: Tue Feb 28 13:42:19 2017 +0100
New test for html generation.
Change-Id: I15f5472e4c8fbc4ce36c9068a36ddea66a850bb0
---
tests/web/test_generator.py | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/tests/web/test_generator.py b/tests/web/test_generator.py
index 553b990..ccc10ae 100644
--- a/tests/web/test_generator.py
+++ b/tests/web/test_generator.py
@@ -1,9 +1,11 @@
#!/usr/bin/python
+# -*- coding: utf-8 -*-
# call using
# > py.test -s -k test_HTML_generator.py
# external imports
import re
+import traceback
# internal imports
from htmllib import HTML, HTMLGenerator
@@ -37,10 +39,22 @@ def test_HTMLGenerator():
html.close_table()
assert tools.compare_html(html.drain(),
"<table><tr><td>1</td><td>2</td></tr></table>")
+ a = u"\u2665"
+ print a
+ with html.plugged():
+ assert html.render_a("test", href="www.test.case")
+ html.render_a(u"test", href="www.test.case")
+ html.render_a("test", href=u"www.test.case")
+ html.render_a(u"test", href=u"www.test.case")
+ try:
+ assert html.render_a(u"test",
href=unicode("www.test.case"), id_=unicode("something"),
class_=unicode("test_%s") % a)
+ except Exception, e:
+ print traceback.print_exc()
+ print e
+
def test_exception_handling():
html = HTMLGenerator()
- html.plug()
try:
raise Exception("Test")
except Exception, e: