'helper for testing IAC + cmd'

def _test_command(self, data):

    self.setUp()
    self.dataq.put(data)
    telnet = telnetlib.Telnet(HOST, self.port)
    self.dataq.join()
    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[0], self.cmds)
    self.assertEqual(cmd[1], tl.NOOPT)
    self.assertEqual(len(''.join(data[:(-1)])), len((txt + cmd)))
    nego.sb_getter = None
    self.tearDown()
