Exemplo n.º 1
0
    def test_shogi_input_is_initable(self):
        shogi = ShogiInput.init("channel_id", [{
            "id": "user1",
            "name": "user1name",
        }, {
            "id": "user2",
            "name": "user2name",
        }])
        self.assertEqual(shogi.channel_id, "channel_id")

        shogi = ShogiInput.init("channel_id", [{
            "id": "user1",
            "name": "user1name",
        }, {
            "id": "user2",
            "name": "user2name",
        }])
        self.assertIsNone(shogi)

        ShogiInput.clear("channel_id")
        shogi = ShogiInput.init("channel_id", [{
            "id": "user1",
            "name": "user1name",
        }, {
            "id": "user2",
            "name": "user2name",
        }])
        self.assertEqual(shogi.channel_id, "channel_id")
Exemplo n.º 2
0
    def test_shogi_input_is_initable(self):
        shogi = ShogiInput.init("channel_id", [{
            "id": "user1",
            "name": "user1name",
        }, {
            "id": "user2",
            "name": "user2name",
        }
        ])
        self.assertEqual(shogi.channel_id, "channel_id")

        shogi = ShogiInput.init("channel_id", [{
            "id": "user1",
            "name": "user1name",
        }, {
            "id": "user2",
            "name": "user2name",
        }
        ])
        self.assertIsNone(shogi)

        ShogiInput.clear("channel_id")
        shogi = ShogiInput.init("channel_id", [{
            "id": "user1",
            "name": "user1name",
        }, {
            "id": "user2",
            "name": "user2name",
        }
        ])
        self.assertEqual(shogi.channel_id, "channel_id")
Exemplo n.º 3
0
def resign(channel, message):
    message.send("最終局面")
    board = ShogiInput.get_shogi_board(channel.channel_id)
    board_str = ShogiOutput.make_board_emoji(board)
    message.send(board_str)
    ShogiInput.clear(channel.channel_id)
Exemplo n.º 4
0
 def test_clear_for_non_exists_channnel(self):
     self.assertIsNone(ShogiInput.clear("channel_id_non_exists"))
Exemplo n.º 5
0
 def test_clear_for_non_exists_channnel(self):
     self.assertIsNone(ShogiInput.clear("channel_id_non_exists"))