<s> """<STR_LIT>""" <EOL> class Error ( Exception ) : <EOL> pass <EOL> class FakeChannelError ( Error ) : <EOL> """<STR_LIT>""" <EOL> class FakeTransport ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . active = True <EOL> def is_active ( self ) : <EOL> return self . active <EOL> class FakeChannel ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , command_response_dict ) : <EOL> self . command_response_dict = command_response_dict <EOL> self . transport = FakeTransport ( ) <EOL> self . timeout = None <EOL> self . last_sent = '<STR_LIT>' <EOL> def set_combine_stderr ( self , unused_arg ) : <EOL> pass <EOL> def get_id ( self ) : <EOL> return <NUM_LIT:1> <EOL> def get_transport ( self ) : <EOL> return self . transport <EOL> def settimeout ( self , timeout ) : <EOL> self . timeout = timeout <EOL> def recv ( self , unused_size ) : <EOL> if self . last_sent : <EOL> last_sent = self . last_sent <EOL> self . last_sent = None <EOL> if last_sent in self . command_response_dict : <EOL> return self . command_response_dict [ last_sent ] <EOL> else : <EOL> raise FakeChannelError ( '<STR_LIT>' % last_sent ) <EOL> def send ( self , command ) : <EOL> self . last_sent = command <EOL> class FakeSshClient ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , command_response_dict ) : <EOL> self . channel = FakeChannel ( command_response_dict ) <EOL> def Connect ( self , ** unused_kwargs ) : <EOL> return self <EOL> def invoke_shell ( self ) : <EOL> return self . channel </s>
