<s> """<STR_LIT>""" <EOL> import unittest <EOL> import logging <EOL> from thespian . actors import ActorSystem <EOL> def simpleActorTestLogging ( ) : <EOL> """<STR_LIT>""" <EOL> import sys <EOL> if sys . platform == '<STR_LIT:win32>' : <EOL> handler = { '<STR_LIT:class>' : '<STR_LIT>' , <EOL> '<STR_LIT:filename>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT> * <NUM_LIT> , <EOL> '<STR_LIT>' : <NUM_LIT:3> , <EOL> } <EOL> else : <EOL> handler = { '<STR_LIT:class>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : sys . stdout , <EOL> } <EOL> return { <EOL> '<STR_LIT:version>' : <NUM_LIT:1> , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : handler , <EOL> } , <EOL> '<STR_LIT:root>' : { '<STR_LIT>' : [ '<STR_LIT>' ] } , <EOL> '<STR_LIT>' : False , <EOL> } <EOL> class LocallyManagedActorSystem ( object ) : <EOL> def setSystemBase ( self , newBase = '<STR_LIT>' , systemCapabilities = None , logDefs = '<STR_LIT>' ) : <EOL> newBaseStr = str ( newBase ) <EOL> if not hasattr ( self , '<STR_LIT>' ) or self . currentBase != newBaseStr : <EOL> ldefs = logDefs if logDefs != '<STR_LIT>' else ( simpleActorTestLogging ( ) if newBase . startswith ( '<STR_LIT>' ) else False ) <EOL> ActorSystem ( logDefs = ldefs ) . shutdown ( ) <EOL> ActorSystem ( newBase , systemCapabilities , logDefs = ldefs ) <EOL> self . currentBase = newBaseStr <EOL> class ActorSystemTestCase ( unittest . TestCase , LocallyManagedActorSystem ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> if not hasattr ( self , '<STR_LIT>' ) : <EOL> self . setSystemBase ( ) <EOL> def tearDown ( self ) : <EOL> if hasattr ( self , '<STR_LIT>' ) : <EOL> ActorSystem ( ) . shutdown ( ) <EOL> delattr ( self , '<STR_LIT>' ) <EOL> import time <EOL> time . sleep ( <NUM_LIT> ) <EOL> @ staticmethod <EOL> def actualActorObject ( actorClass ) : <EOL> """<STR_LIT>""" <EOL> aAddr = ActorSystem ( ) . createActor ( actorClass ) <EOL> return ActorSystem ( ) . _systemBase . actorRegistry [ aAddr . actorAddressString ] . instance </s>
