Fix move quoting

This commit is contained in:
2025-12-14 23:13:39 +01:00
parent 9ee3539eeb
commit 499639823e
9 changed files with 174 additions and 32 deletions

View File

@@ -1,4 +1,4 @@
from board_mate_client import ApiClient, DefaultApi, GameDto
from board_mate_client import ApiClient, DefaultApi, GameDto, MoveDto
class ApiController:
@@ -10,14 +10,12 @@ class ApiController:
try:
with ApiClient(self.config) as client:
api = DefaultApi(client)
game = GameDto(
white_name="Alice",
black_name="Bob",
time_value=300,
increment=10
white_name=white_name,
black_name=black_name,
time_value=time_value,
increment=increment
)
response = api.create_party(game)
print("Raw response:", response)
return str(response.data)
@@ -29,4 +27,15 @@ class ApiController:
with ApiClient(self.config) as client:
api = DefaultApi(client)
response = api.retrieve_games(game_id)
return GameDto.from_dict(response.data)
return GameDto.from_dict(response.data)
def add_move(self, game_id, notation) -> str:
with ApiClient(self.config) as client:
api = DefaultApi(client)
move = MoveDto(
notation=notation,
)
response = api.add_move(game_id, move)
return str(response.data)