本文整理汇总了Python中lib.game.Game.contestant_guess方法的典型用法代码示例。如果您正苦于以下问题:Python Game.contestant_guess方法的具体用法?Python Game.contestant_guess怎么用?Python Game.contestant_guess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.game.Game
的用法示例。
在下文中一共展示了Game.contestant_guess方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_contestant_can_switch
# 需要导入模块: from lib.game import Game [as 别名]
# 或者: from lib.game.Game import contestant_guess [as 别名]
def test_contestant_can_switch(self):
door_1, door_2, door_3 = Door(False), Door(True), Door(False)
game = Game(door_1, door_2, door_3)
game.contestant_guess = door_1
game.contestant_switch()
self.assertNotEqual(door_1, game.contestant_guess)
self.assertIsInstance(game.contestant_guess, Door)
示例2: test_case_where_contestant_guesses_correctly
# 需要导入模块: from lib.game import Game [as 别名]
# 或者: from lib.game.Game import contestant_guess [as 别名]
def test_case_where_contestant_guesses_correctly(self):
door_1, door_2, door_3 = Door(False), Door(True), Door(False)
game = Game(door_1, door_2, door_3)
game.contestant_guess = door_2
game.host_open_door()
self.assertEqual(False, door_2.is_open)
self.assertEqual(True, door_1.is_open ^ door_3.is_open)
示例3: test_first_round
# 需要导入模块: from lib.game import Game [as 别名]
# 或者: from lib.game.Game import contestant_guess [as 别名]
def test_first_round(self):
door_1, door_2, door_3 = Door(False), Door(False), Door(True)
game = Game(door_1, door_2, door_3)
game.contestant_guess = door_1
game.host_open_door()
self.assertEqual(True, door_2.is_open)
示例4: test_correct_win
# 需要导入模块: from lib.game import Game [as 别名]
# 或者: from lib.game.Game import contestant_guess [as 别名]
def test_correct_win(self):
door_1, door_2, door_3 = Door(False), Door(True), Door(False)
game = Game(door_1, door_2, door_3)
game.contestant_guess = door_2
self.assertEqual(True, game.contestant_has_won())