From 352861d332907e49c747a970ea156fdafa26a08b Mon Sep 17 00:00:00 2001 From: gbtami Date: Mon, 13 Jan 2025 01:27:32 +0100 Subject: [PATCH] Fix unit test --- tests/test_compress.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_compress.py b/tests/test_compress.py index 8d2b51445..0c4a04ebb 100644 --- a/tests/test_compress.py +++ b/tests/test_compress.py @@ -3,9 +3,8 @@ import string import unittest -from compress import get_encode_method, get_decode_method from fairy import FairyBoard -from variants import VARIANTS +from variants import get_server_variant, VARIANTS class EncodeDecodeTestCase(unittest.TestCase): @@ -30,8 +29,9 @@ def test_encode_decode(self): board = FairyBoard(variant, initial_fen=FEN) moves = board.legal_moves() - encode_method = get_encode_method(variant) - decode_method = get_decode_method(variant) + server_variant = get_server_variant(variant, False) + encode_method = server_variant.move_encoding + decode_method = server_variant.move_decoding saved_restored = [*map(decode_method, map(encode_method, moves))] self.assertEqual(saved_restored, moves)