def _check_engine(self, eng):
    self.assertEqual(eng.is_running(), True)
    eng.send('aei\n')
    response = eng.waitfor('aeiok')
    self.assertEqual(response[(- 1)], 'aeiok')
    self.assertRaises(socket.timeout, eng.readline, timeout=0.05)
    eng.send('isready\n')
    response = eng.readline()
    self.assertEqual(response, 'readyok')
    eng.send('quit\n')
    eng.waitfor('log')
    self.assertRaises(EngineException, eng.waitfor, 'invalid', timeout=0.05)
    eng.cleanup()
    self.assertEqual(eng.active, False)
def _check_engine(self, eng):
    self.assertEqual(eng.is_running(), True)
    eng.send('aei\n')
    response = eng.waitfor('aeiok')
    self.assertEqual(response[(- 1)], 'aeiok')
    self.assertRaises(socket.timeout, eng.readline, timeout=0.05)
    eng.send('isready\n')
    response = eng.readline()
    self.assertEqual(response, 'readyok')
    eng.send('quit\n')
    eng.waitfor('log')
    self.assertRaises(EngineException, eng.waitfor, 'invalid', timeout=0.05)
    eng.cleanup()
    self.assertEqual(eng.active, False)