Skip to content

[Feature] Add lobby get game status api - #97

Open
s9891326 wants to merge 3 commits into
masterfrom
feature/lobby_game_status_api
Open

[Feature] Add lobby get game status api#97
s9891326 wants to merge 3 commits into
masterfrom
feature/lobby_game_status_api

Conversation

@s9891326

@s9891326 s9891326 commented Nov 3, 2023

Copy link
Copy Markdown
Collaborator
  • 串接大平台項目 #92 中的第6項新增API 取得遊戲狀態(/games/{gameId}/status) Authorization: Bearer <playerJwt>
  • 在新開發的test case中有使用mock的方式把call大平台的API先mock掉,因為我們自己創建的jwt token無法取得對應的player_id

Comment thread tests/test_lobby_api.py
Comment on lines +68 to +75
@patch("love_letter.web.app.JWTBearer")
def test_2_game_status(self, mock_jwt_bearer):
# 把呼叫大平台 /users/me 的api給mock掉,因為我們自己創建的jwt token無法取得對應的player_id
mock_jwt_bearer.get_player_id.return_value = "6497f6f226b40d440b9a90cc"
response = self.t.get(
f"/games/{self.game_id}/status", headers={"Authorization": self.jwt_token}
)
data = response.json()

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文中提及的主要是這段code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant