<s> """<STR_LIT>""" <EOL> import unittest <EOL> import jsonrpc <EOL> from types import * <EOL> class Service ( object ) : <EOL> @ jsonrpc . ServiceMethod <EOL> def echo ( self , arg ) : <EOL> return arg <EOL> class TestCGIWrapper ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> pass <EOL> def tearDown ( self ) : <EOL> pass <EOL> def test_runCGIHandler ( self ) : <EOL> from StringIO import StringIO <EOL> json = u'<STR_LIT>' <EOL> fin = StringIO ( json ) <EOL> fout = StringIO ( ) <EOL> env = { "<STR_LIT>" : len ( json ) } <EOL> jsonrpc . handleCGI ( service = Service ( ) , fin = fin , fout = fout , env = env ) <EOL> data = StringIO ( fout . getvalue ( ) ) <EOL> data . readline ( ) <EOL> data . readline ( ) <EOL> data = data . read ( ) <EOL> self . assertEquals ( jsonrpc . loads ( data ) , { "<STR_LIT:result>" : "<STR_LIT>" , "<STR_LIT:error>" : None , "<STR_LIT:id>" : "<STR_LIT>" } ) </s>
