<s> try : <EOL> from xmlrpc . client import ServerProxy <EOL> except ImportError : <EOL> from xmlrpclib import ServerProxy <EOL> from circuits import Component <EOL> from circuits . web import Controller , XMLRPC <EOL> from . helpers import urlopen <EOL> class App ( Component ) : <EOL> def eval ( self , s ) : <EOL> return eval ( s ) <EOL> class Root ( Controller ) : <EOL> def index ( self ) : <EOL> return "<STR_LIT>" <EOL> def test ( webapp ) : <EOL> rpc = XMLRPC ( "<STR_LIT>" ) <EOL> test = App ( ) <EOL> rpc . register ( webapp ) <EOL> test . register ( webapp ) <EOL> f = urlopen ( webapp . server . http . base ) <EOL> s = f . read ( ) <EOL> assert s == b"<STR_LIT>" <EOL> url = "<STR_LIT>" % webapp . server . http . base <EOL> server = ServerProxy ( url , allow_none = True ) <EOL> r = server . eval ( "<STR_LIT>" ) <EOL> assert r == <NUM_LIT:3> <EOL> rpc . unregister ( ) <EOL> test . unregister ( ) </s>
