bots: Fix tictactoe, connect_four emoji
MODIFY
zulip_bots/zulip_bots/bots/connect_four/connect_four.py
zulip_bots/zulip_bots/bots/connect_four/connect_four.py
@@ -14,11 +14,11 @@ class ConnectFourMessageHandler(object):
board_str += '\n\n'
for column in range(0, 7):
if board[row][column] == 0:
- board_str += ':heavy_large_circle: '
+ board_str += ':white_circle: '
elif board[row][column] == 1:
- board_str += ':blue_circle: '
+ board_str += self.tokens[0] + ' '
elif board[row][column] == -1:
- board_str += ':red_circle: '
+ board_str += self.tokens[1] + ' '
return board_str

MODIFY
zulip_bots/zulip_bots/bots/connect_four/test_connect_four.py
zulip_bots/zulip_bots/bots/connect_four/test_connect_four.py
@@ -74,18 +74,18 @@ class TestConnectFourBot(BotTestCase, DefaultTests):
def test_game_message_handler_responses(self) -> None:
board = ':one: :two: :three: :four: :five: :six: :seven:\n\n' + '\
-:heavy_large_circle: :heavy_large_circle: :heavy_large_circle: :heavy_large_circle: \
-:heavy_large_circle: :heavy_large_circle: :heavy_large_circle: \n\n\
-:heavy_large_circle: :heavy_large_circle: :heavy_large_circle: :heavy_large_circle: \
-:heavy_large_circle: :heavy_large_circle: :heavy_large_circle: \n\n\
-:heavy_large_circle: :heavy_large_circle: :heavy_large_circle: :heavy_large_circle: \
-:heavy_large_circle: :heavy_large_circle: :heavy_large_circle: \n\n\
-:blue_circle: :red_circle: :heavy_large_circle: :heavy_large_circle: :heavy_large_circle: \
-:heavy_large_circle: :heavy_large_circle: \n\n\
-:blue_circle: :red_circle: :heavy_large_circle: :heavy_large_circle: :heavy_large_circle: \
-:heavy_large_circle: :heavy_large_circle: \n\n\
-:blue_circle: :red_circle: :heavy_large_circle: :heavy_large_circle: :heavy_large_circle: \
-:heavy_large_circle: :heavy_large_circle: '
+:white_circle: :white_circle: :white_circle: :white_circle: \
+:white_circle: :white_circle: :white_circle: \n\n\
+:white_circle: :white_circle: :white_circle: :white_circle: \
+:white_circle: :white_circle: :white_circle: \n\n\
+:white_circle: :white_circle: :white_circle: :white_circle: \
+:white_circle: :white_circle: :white_circle: \n\n\
+:blue_circle: :red_circle: :white_circle: :white_circle: :white_circle: \
+:white_circle: :white_circle: \n\n\
+:blue_circle: :red_circle: :white_circle: :white_circle: :white_circle: \
+:white_circle: :white_circle: \n\n\
+:blue_circle: :red_circle: :white_circle: :white_circle: :white_circle: \
+:white_circle: :white_circle: '
bot, bot_handler = self._get_handlers()
self.assertEqual(bot.gameMessageHandler.parse_board(
self.almost_win_board), board)

MODIFY
zulip_bots/zulip_bots/bots/tictactoe/test_tictactoe.py
zulip_bots/zulip_bots/bots/tictactoe/test_tictactoe.py
@@ -117,7 +117,7 @@ class TestTicTacToeBot(BotTestCase, DefaultTests):
def test_player_color(self) -> None:
turn = 0
- response = ':cross_mark_button:'
+ response = ':x:'
self._test_player_color(turn, response)
def _test_player_color(self, turn: int, expected_response: str) -> None:
@@ -145,9 +145,9 @@ class TestTicTacToeBot(BotTestCase, DefaultTests):
board = [[0, 1, 0],
[0, 0, 0],
[0, 0, 2]]
- response = ':one: :cross_mark_button: :three:\n\n' +\
+ response = ':one: :x: :three:\n\n' +\
':four: :five: :six:\n\n' +\
- ':seven: :eight: :o_button:\n\n'
+ ':seven: :eight: :o:\n\n'
self._test_parse_board(board, response)
def _test_parse_board(self, board: List[List[int]], expected_response: str) -> None:

MODIFY
zulip_bots/zulip_bots/bots/tictactoe/tictactoe.py
zulip_bots/zulip_bots/bots/tictactoe/tictactoe.py
@@ -209,7 +209,7 @@ class TicTacToeModel(object):
class TicTacToeMessageHandler(object):
- tokens = [':cross_mark_button:', ':o_button:']
+ tokens = [':x:', ':o:']
def parse_row(self, row: Tuple[int, int], row_num: int) -> str:
''' Takes the row passed in as a list and returns it as a string. '''

bots: Fix tictactoe, connect_four emoji