/usr/lib/python2.7/dist-packages/twisted/lore/test/test_docbook.py is in python-twisted-lore 13.2.0-1ubuntu1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.lore.docbook}.
"""
from xml.dom.minidom import Element, Text
from twisted.trial.unittest import TestCase
from twisted.lore.docbook import DocbookSpitter
class DocbookSpitterTests(TestCase):
"""
Tests for L{twisted.lore.docbook.DocbookSpitter}.
"""
def test_li(self):
"""
L{DocbookSpitter} wraps any non-I{p} elements found intside any I{li}
elements with I{p} elements.
"""
output = []
spitter = DocbookSpitter(output.append)
li = Element('li')
li.appendChild(Element('p'))
text = Text()
text.data = 'foo bar'
li.appendChild(text)
spitter.visitNode(li)
self.assertEqual(
''.join(output),
'<listitem><para></para><para>foo bar</para></listitem>')
|