1
# Copyright (c) 2008 Twisted Matrix Laboratories.
2
# See LICENSE for details.
5
Tests for L{twisted.python.htmlizer}.
8
from StringIO import StringIO
10
from twisted.trial.unittest import TestCase
11
from twisted.python.htmlizer import filter
14
class FilterTests(TestCase):
16
Tests for L{twisted.python.htmlizer.filter}.
20
If passed an empty input file, L{filter} writes a I{pre} tag containing
21
only an end marker to the output file.
26
self.assertEqual(output.getvalue(), '<pre><span class="py-src-endmarker"></span></pre>\n')
29
def test_variable(self):
31
If passed an input file containing a variable access, L{filter} writes
32
a I{pre} tag containing a I{py-src-variable} span containing the
35
input = StringIO("foo\n")
40
'<pre><span class="py-src-variable">foo</span><span class="py-src-newline">\n'
41
'</span><span class="py-src-endmarker"></span></pre>\n')