def test_telnet(reads=(), cls=TelnetAlike, use_poll=None):
 for x in reads:
  assert (type(x) is bytes), x
 with test_socket(reads):
  telnet = cls('dummy', 0)
  telnet._messages = ''
  if (use_poll is not None):
   if (use_poll and (not telnet._has_poll)):
    raise unittest.SkipTest('select.poll() required.')
   telnet._has_poll = use_poll
 return telnet

def test_telnet ( reads = ( ) , cls = TelnetAlike , use_poll = None ) : for x in reads : assert ( type ( x ) is bytes ) , x with test_socket ( reads ) : telnet = cls ( 'dummy' , 0 ) telnet . _messages = '' if ( use_poll is not None ) : if ( use_poll and ( not telnet . _has_poll ) ) : raise unittest . SkipTest ( 'select.poll() required.' ) telnet . _has_poll = use_poll return telnet
return a telnetlib .