-
-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integrations: Remove !avatar from game handler.
The issue linked to this commit suggest suggests to replace the avatar with the username only, I just needed to remove !avatar as the code already shows the username. Fixes part of #632.
- Loading branch information
1 parent
e995e52
commit 9ce2ea5
Showing
2 changed files
with
16 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -229,7 +229,7 @@ def test_quit_invite(self) -> None: | |
} | ||
} | ||
self.verify_response( | ||
'quit', 'Game cancelled.\n!avatar([email protected]) **foo** quit.', 0, bot, 'foo') | ||
'quit', 'Game cancelled.\n**foo** quit.', 0, bot, 'foo') | ||
|
||
def test_user_already_in_game_errors(self) -> None: | ||
bot = self.setup_game() | ||
|
@@ -313,14 +313,14 @@ def test_draw(self) -> None: | |
|
||
def test_normal_turns(self) -> None: | ||
bot = self.setup_game() | ||
self.verify_response('move 3', '**foo** moved in column 3\n\nfoo\n\n!avatar([email protected]) It\'s **baz**\'s (:red_circle:) turn.', | ||
self.verify_response('move 3', '**foo** moved in column 3\n\nfoo\n\nIt\'s **baz**\'s (:red_circle:) turn.', | ||
0, bot=bot, stream='test', subject='test game') | ||
self.verify_response('move 3', '**baz** moved in column 3\n\nfoo\n\n!avatar([email protected]) It\'s **foo**\'s (:blue_circle:) turn.', | ||
self.verify_response('move 3', '**baz** moved in column 3\n\nfoo\n\nIt\'s **foo**\'s (:blue_circle:) turn.', | ||
0, bot=bot, stream='test', subject='test game', user_name='baz') | ||
|
||
def test_wrong_turn(self) -> None: | ||
bot = self.setup_game() | ||
self.verify_response('move 5', '!avatar([email protected]) It\'s **foo**\'s (:blue_circle:) turn.', 0, | ||
self.verify_response('move 5', 'It\'s **foo**\'s (:blue_circle:) turn.', 0, | ||
bot=bot, stream='test', subject='test game', user_name='baz') | ||
|
||
def test_private_message_error(self) -> None: | ||
|
@@ -390,7 +390,7 @@ def test_game_over_and_leaderboard(self) -> None: | |
bot = self.setup_game() | ||
bot.put_user_cache() | ||
with patch('zulip_bots.bots.game_handler_bot.game_handler_bot.MockModel.determine_game_over', return_value='[email protected]'): | ||
self.verify_response('move 3', '!avatar([email protected]) **foo** won! :tada:', | ||
self.verify_response('move 3', '**foo** won! :tada:', | ||
1, bot=bot, stream='test', subject='test game') | ||
leaderboard = '**Most wins**\n\n\ | ||
Player | Games Won | Games Drawn | Games Lost | Total Games\n\ | ||
|
@@ -403,12 +403,12 @@ def test_game_over_and_leaderboard(self) -> None: | |
def test_current_turn_winner(self) -> None: | ||
bot = self.setup_game() | ||
with patch('zulip_bots.bots.game_handler_bot.game_handler_bot.MockModel.determine_game_over', return_value='current turn'): | ||
self.verify_response('move 3', '!avatar([email protected]) **foo** won! :tada:', | ||
self.verify_response('move 3', '**foo** won! :tada:', | ||
1, bot=bot, stream='test', subject='test game') | ||
|
||
def test_computer_turn(self) -> None: | ||
bot = self.setup_computer_game() | ||
self.verify_response('move 3', '**foo** moved in column 3\n\nfoo\n\n!avatar([email protected]) It\'s **test-bot**\'s (:red_circle:) turn.', | ||
self.verify_response('move 3', '**foo** moved in column 3\n\nfoo\n\nIt\'s **test-bot**\'s (:red_circle:) turn.', | ||
0, bot=bot, stream='test', subject='test game') | ||
with patch('zulip_bots.bots.game_handler_bot.game_handler_bot.MockModel.determine_game_over', return_value='[email protected]'): | ||
self.verify_response('move 5', 'I won! Well Played!', | ||
|
@@ -462,7 +462,6 @@ def test_get_game_info(self) -> None: | |
def test_parse_message(self) -> None: | ||
bot = self.setup_game() | ||
self.verify_response('move 3', 'Join your game using the link below!\n\n> **Game `abc123`**\n\ | ||
> !avatar([email protected])\n\ | ||
> foo test game\n\ | ||
> 2/2 players\n\ | ||
> **[Join Game](/#narrow/stream/test/topic/test game)**', 0, bot=bot) | ||
|
@@ -471,7 +470,6 @@ def test_parse_message(self) -> None: | |
To move subjects, send your message again, otherwise join the game using the link below. | ||
> **Game `abc123`** | ||
> !avatar([email protected]) | ||
> foo test game | ||
> 2/2 players | ||
> **[Join Game](/#narrow/stream/test/topic/test game)**''', 0, bot=bot, stream='test 2', subject='game 2') | ||
|
@@ -485,7 +483,6 @@ def test_change_game_subject(self) -> None: | |
To move subjects, send your message again, otherwise join the game using the link below. | ||
> **Game `abcdefg`** | ||
> !avatar([email protected]) | ||
> foo test game | ||
> 2/2 players | ||
> **[Join Game](/#narrow/stream/test2/topic/test game 2)**''', 0, bot=bot, user_name='bar', stream='test game', subject='test2') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters