Skip to content

Commit

Permalink
Add test using MockTransport
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkZH committed Oct 8, 2024
1 parent ebb687c commit c0ac01b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3147,6 +3147,21 @@ def test_fairy_sf_initialize(self):
with chess.engine.SimpleEngine.popen_uci("fairy-stockfish", setpgrp=True, debug=True):
pass

def test_uci_option_parse(self):
async def main():
protocol = chess.engine.UciProtocol()
mock = chess.engine.MockTransport(protocol)

mock.expect("uci", ["option name UCI_Variant type combo default chess var bughouse var chess var mini var minishogi var threekings", "uciok"])
await protocol.initialize()
mock.assert_done()

mock.expect("isready", ["readyok"])
await protocol.ping()
mock.assert_done()

asyncio.run(main())

@catchAndSkip(FileNotFoundError, "need crafty")
def test_crafty_play_to_mate(self):
logging.disable(logging.WARNING)
Expand Down

0 comments on commit c0ac01b

Please sign in to comment.