diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-03-09 18:04:19 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-03-09 18:04:19 -0500 |
commit | 3287ffb095f15f8707f8935850a8dd466d71e4f1 (patch) | |
tree | 6b3c3aee8d3b22bba9f1c349d9e71e862bbae119 | |
parent | f9faef9ac1b530b59a61411d0accd949566420fa (diff) | |
download | mako-3287ffb095f15f8707f8935850a8dd466d71e4f1.tar.gz |
- reduce the pygments strings we're searching for to accommodate for
changes in pygments formatting; we might be losing
a bit of what was tested here originally but we still assert pygments
is taking place.
-rw-r--r-- | test/test_exceptions.py | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/test/test_exceptions.py b/test/test_exceptions.py index 3330a1f..8321b25 100644 --- a/test/test_exceptions.py +++ b/test/test_exceptions.py @@ -91,9 +91,7 @@ ${u'привет'} assert "".encode(sys.getdefaultencoding(), 'htmlentityreplace') in html_error else: - assert '<pre>3</pre></div></td><td class="code">'\ - '<div class="syntax-highlighted"><pre><span '\ - 'class="cp">${</span><span class="s">u''\ + assert 'u''\ 'привет'\ ''</span><span class="cp">}</span>'.encode( sys.getdefaultencoding(), @@ -188,12 +186,8 @@ ${foobar} ${self.body()} """) - assert '<div class="sourceline"><table class="syntax-highlightedtable">'\ - '<tr><td class="linenos"><div class="linenodiv"><pre>3</pre>'\ - '</div></td><td class="code"><div class="syntax-highlighted">'\ - '<pre><span class="err">$</span><span class="p">{</span>'\ - '<span class="n">foobar</span><span class="p">}</span>' in \ - result_lines(l.get_template("foo.html").render_unicode()) + assert '<div class="sourceline"><table class="syntax-highlightedtable">' in \ + l.get_template("foo.html").render_unicode() @requires_no_pygments_exceptions def test_format_exceptions_no_pygments(self): @@ -223,24 +217,12 @@ ${foobar} l.put_string("foo.html", """# -*- coding: utf-8 -*-\n${u'привет' + foobar}""") if compat.py3k: - assert '<table class="error syntax-highlightedtable"><tr><td '\ - 'class="linenos"><div class="linenodiv"><pre>2</pre>'\ - '</div></td><td class="code"><div class="error '\ - 'syntax-highlighted"><pre><span class="cp">${</span>'\ - '<span class="s">'привет'</span> <span class="o">+</span> '\ - '<span class="n">foobar</span><span class="cp">}</span>'\ - '<span class="x"></span>' in \ - result_lines(l.get_template("foo.html").render().decode('utf-8')) + assert ''привет'</span>' in \ + l.get_template("foo.html").render().decode('utf-8') else: - assert '<table class="error syntax-highlightedtable"><tr><td '\ - 'class="linenos"><div class="linenodiv"><pre>2</pre>'\ - '</div></td><td class="code"><div class="error '\ - 'syntax-highlighted"><pre><span class="cp">${</span>'\ - '<span class="s">u'прив'\ - 'ет'</span> <span class="o">+</span> '\ - '<span class="n">foobar</span><span class="cp">}</span>'\ - '<span class="x"></span>' in \ - result_lines(l.get_template("foo.html").render().decode('utf-8')) + assert 'u'прив'\ + 'ет'</span>' in \ + l.get_template("foo.html").render().decode('utf-8') @requires_no_pygments_exceptions def test_utf8_format_exceptions_no_pygments(self): |