'helper for testing IAC + cmd'

def _test_command(self, data):

    telnet = test_telnet(data)
    data_len = len(''.join(data))
    nego = nego_collector()
    telnet.set_option_negotiation_callback(nego.do_nego)
    txt = telnet.read_all()
    cmd = nego.seen
    self.assertTrue((len(cmd) > 0))
    self.assertIn(cmd[:1], self.cmds)
    self.assertEqual(cmd[1:2], tl.NOOPT)
    self.assertEqual(data_len, len((txt + cmd)))
    nego.sb_getter = None
