Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add lobby get game status api #97

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

s9891326
Copy link
Collaborator

@s9891326 s9891326 commented Nov 3, 2023

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

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
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