<s> """<STR_LIT>""" <EOL> from xml . dom . minidom import Element , Text <EOL> from twisted . trial . unittest import TestCase <EOL> from twisted . python . filepath import FilePath <EOL> from twisted . lore . scripts . lore import IProcessor <EOL> from twisted . plugin import getPlugins <EOL> from twisted . lore . lmath import formulaeToImages <EOL> class PluginTests ( TestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_discoverable ( self ) : <EOL> """<STR_LIT>""" <EOL> plugins = getPlugins ( IProcessor ) <EOL> lmath = [ p for p in plugins if p . name == "<STR_LIT>" ] <EOL> self . assertEqual ( len ( lmath ) , <NUM_LIT:1> , "<STR_LIT>" % ( lmath , ) ) <EOL> class FormulaeTests ( TestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_insertImages ( self ) : <EOL> """<STR_LIT>""" <EOL> parent = Element ( '<STR_LIT>' ) <EOL> base = FilePath ( self . mktemp ( ) ) <EOL> base . makedirs ( ) <EOL> macros = Element ( '<STR_LIT>' ) <EOL> macros . setAttribute ( '<STR_LIT:class>' , '<STR_LIT>' ) <EOL> text = Text ( ) <EOL> text . data = '<STR_LIT:foo>' <EOL> macros . appendChild ( text ) <EOL> parent . appendChild ( macros ) <EOL> formula = Element ( '<STR_LIT>' ) <EOL> formula . setAttribute ( '<STR_LIT:class>' , '<STR_LIT>' ) <EOL> text = Text ( ) <EOL> text . data = '<STR_LIT:bar>' <EOL> formula . appendChild ( text ) <EOL> parent . appendChild ( formula ) <EOL> commands = [ ] <EOL> formulaeToImages ( parent , base . path , _system = commands . append ) <EOL> self . assertEqual ( <EOL> parent . toxml ( ) , <EOL> '<STR_LIT>' ) </s>
