예제 #1
0
파일: test_games.py 프로젝트: dmaclay/vumi
    def test_game_init(self):
        game = RockPaperScissorsGame(5, 'p1')
        self.assertEquals('p1', game.player_1)
        self.assertEquals(None, game.player_2)
        self.assertEquals((0, 0), game.scores)
        self.assertEquals(None, game.current_move)

        game.set_player_2('p2')
        self.assertEquals('p1', game.player_1)
        self.assertEquals('p2', game.player_2)
        self.assertEquals((0, 0), game.scores)
        self.assertEquals(None, game.current_move)
예제 #2
0
파일: test_games.py 프로젝트: dmaclay/vumi
 def get_game(self, scores=None):
     game = RockPaperScissorsGame(5, 'p1')
     game.set_player_2('p2')
     if scores is not None:
         game.scores = scores
     return game