def test_protocol_versions(self):
    eng = MockEngine(protocol0)
    ctl = EngineController(eng)
    self.assertEqual(ctl.ident['name'], 'Mock0')
    self.assertEqual(ctl.ident['author'], 'Janzert')
    self.assertEqual(ctl.protocol_version, 0)
    ctl.newgame()
    pos = board.Position(board.Color.GOLD, 4, board.BASIC_SETUP)
    ctl.setposition(pos)
    ctl.cleanup()
    eng = MockEngine(bad_protocol)
    eng.log = MockLog()
    ctl = EngineController(eng)
    self.assertIn('Unrecognized protocol version', eng.log.warning)
    pos = board.Position(board.Color.GOLD, 4, board.BASIC_SETUP)
    ctl.newgame()
    ctl.setposition(pos)
    ctl.go()
    ctl.stop()
    ctl.quit()
def test_protocol_versions(self):
    eng = MockEngine(protocol0)
    ctl = EngineController(eng)
    self.assertEqual(ctl.ident['name'], 'Mock0')
    self.assertEqual(ctl.ident['author'], 'Janzert')
    self.assertEqual(ctl.protocol_version, 0)
    ctl.newgame()
    pos = board.Position(board.Color.GOLD, 4, board.BASIC_SETUP)
    ctl.setposition(pos)
    ctl.cleanup()
    eng = MockEngine(bad_protocol)
    eng.log = MockLog()
    ctl = EngineController(eng)
    self.assertIn('Unrecognized protocol version', eng.log.warning)
    pos = board.Position(board.Color.GOLD, 4, board.BASIC_SETUP)
    ctl.newgame()
    ctl.setposition(pos)
    ctl.go()
    ctl.stop()
    ctl.quit()