當前位置: 首頁>>代碼示例>>Python>>正文


Python GameController._winner方法代碼示例

本文整理匯總了Python中durak.controller.GameController._winner方法的典型用法代碼示例。如果您正苦於以下問題:Python GameController._winner方法的具體用法?Python GameController._winner怎麽用?Python GameController._winner使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在durak.controller.GameController的用法示例。


在下文中一共展示了GameController._winner方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_winner_property

# 需要導入模塊: from durak.controller import GameController [as 別名]
# 或者: from durak.controller.GameController import _winner [as 別名]
 def test_winner_property(self):
     controller = GameController()
     given_list = [controller._player1, controller._player2, None]
     expected_list = [controller.PLAYER1, controller.PLAYER2, None]
     for given, expected in zip(given_list, expected_list):
         controller._winner = given
         self.assertEqual(controller.winner, expected)
開發者ID:drtyrsa,項目名稱:durak,代碼行數:9,代碼來源:tests.py

示例2: test_if_winner_is_ignored_first_move_is_selected_by_trump

# 需要導入模塊: from durak.controller import GameController [as 別名]
# 或者: from durak.controller.GameController import _winner [as 別名]
    def test_if_winner_is_ignored_first_move_is_selected_by_trump(self):
        controller = GameController()
        controller._winner = controller._player1

        with patch.object(controller,
                          '_get_first_to_move_by_trump') as _get_first_mock:
            controller.start_new_game()
            self.assertEqual(controller._to_move, _get_first_mock.return_value)
開發者ID:drtyrsa,項目名稱:durak,代碼行數:10,代碼來源:tests.py

示例3: test_if_winner_and_not_ignored_it_selects_first_move

# 需要導入模塊: from durak.controller import GameController [as 別名]
# 或者: from durak.controller.GameController import _winner [as 別名]
    def test_if_winner_and_not_ignored_it_selects_first_move(self):
        controller = GameController()
        controller._winner = controller._player1

        with patch.object(controller,
                          '_get_first_to_move_by_trump') as _get_first_mock:
            controller.start_new_game(ignore_winner=False)
            self.assertEqual(controller._to_move, controller._player1)
            self.assertFalse(_get_first_mock.called)
開發者ID:drtyrsa,項目名稱:durak,代碼行數:11,代碼來源:tests.py


注:本文中的durak.controller.GameController._winner方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。