<s> import unittest <EOL> import trac . tests . compat <EOL> from trac . mimeview . patch import PatchRenderer <EOL> from trac . test import EnvironmentStub , MockRequest <EOL> from trac . web . api import RequestDone <EOL> from trac . wiki . web_api import WikiRenderer <EOL> class WikiRendererTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . env = EnvironmentStub ( ) <EOL> self . mod = WikiRenderer ( self . env ) <EOL> def test_load_stylesheet ( self ) : <EOL> text = """<STR_LIT>""" <EOL> req = MockRequest ( self . env , method = '<STR_LIT:POST>' , path_info = '<STR_LIT>' , <EOL> args = { '<STR_LIT:id>' : '<STR_LIT>' , '<STR_LIT:text>' : text } ) <EOL> self . assertTrue ( self . mod . match_request ( req ) ) <EOL> try : <EOL> self . mod . process_request ( req ) <EOL> self . fail ( '<STR_LIT>' ) <EOL> except RequestDone : <EOL> output = req . response_sent . getvalue ( ) <EOL> self . assertIn ( '<STR_LIT>' , output ) <EOL> self . assertIn ( '<STR_LIT>' , output ) <EOL> self . assertIn ( '<STR_LIT>' <EOL> '<STR_LIT>' , output ) <EOL> def suite ( ) : <EOL> return unittest . makeSuite ( WikiRendererTestCase ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( defaultTest = '<STR_LIT>' ) </s>
