当前位置: 首页>>代码示例>>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;未经允许,请勿转载。