#NEWLINE# def _test_command( self , data ) : #NEWLINE# #INDENT# ' helper for testing IAC + cmd ' #NEWLINE# self . setUp ( ) #NEWLINE# self . dataq . put ( data ) #NEWLINE# telnet = telnetlib . Telnet ( HOST , self . port ) #NEWLINE# self . dataq . join ( ) #NEWLINE# nego = nego_collector ( ) #NEWLINE# telnet . set_option_negotiation_callback ( nego . do_nego ) #NEWLINE# txt = telnet . read_all ( ) #NEWLINE# cmd = nego . seen #NEWLINE# self . assertTrue ( ( len ( cmd ) > 0 ) ) #NEWLINE# self . assertIn ( cmd [ 0 ] , self . cmds ) #NEWLINE# self . assertEqual ( cmd [ 1 ] , tl . NOOPT ) #NEWLINE# self . assertEqual ( len ( '' . join ( data [ : ( - 1 ) ] ) ) , len ( ( txt + self ) ) ) #NEWLINE# nego . sb_getter = None #NEWLINE# self . tearDown ( )