コード例 #1
0
ファイル: round.py プロジェクト: jminuscula/dixit-online
    def setUp(self):
        self.user = User.objects.create(username='******', email='test@localhost', password='******')
        self.user2 = User.objects.create(username='******', email='test2@localhost', password='******')
        self.user3 = User.objects.create(username='******', email='test3@localhost', password='******')

        self.game = Game.new_game(name='test', user=self.user, player_name='storyteller')
        self.current = self.game.current_round
        self.player2 = self.game.add_player(self.user2, 'player2')
        self.player3 = self.game.add_player(self.user3, 'player3')
コード例 #2
0
    def test_started_game_without_players_is_abandoned(self):
        g = Game.new_game(name='test', user=self.user, player_name='storyteller')
        storyteller = g.current_round.turn
        Play.play_for_round(g.current_round, storyteller, storyteller._pick_card(), 'story')

        player2 = g.add_player(self.user2, 'player2')
        Play.play_for_round(g.current_round, player2, player2._pick_card())

        g.players.all().delete()
        self.assertEqual(g.status, GameStatus.ABANDONED)
コード例 #3
0
ファイル: card.py プロジェクト: zoemy/dixit-online
    def setUp(self):
        self.user = User.objects.create(username='******',
                                        email='test@localhost',
                                        password='******')
        self.user2 = User.objects.create(username='******',
                                         email='test2@localhost',
                                         password='******')

        self.game = Game.new_game(name='test',
                                  user=self.user,
                                  player_name='storyteller')
        self.player2 = self.game.add_player(self.user2, 'player2')
コード例 #4
0
    def setUp(self):
        self.user = User.objects.create(username='******',
                                        email='test@localhost',
                                        password='******')
        self.user2 = User.objects.create(username='******',
                                         email='test2@localhost',
                                         password='******')
        self.user3 = User.objects.create(username='******',
                                         email='test3@localhost',
                                         password='******')
        self.user4 = User.objects.create(username='******',
                                         email='test4@localhost',
                                         password='******')

        self.game = Game.new_game(name='test',
                                  user=self.user,
                                  player_name='storyteller')
        self.current = self.game.current_round
        self.player2 = self.game.add_player(self.user2, 'player2')
        self.player3 = self.game.add_player(self.user3, 'player3')
コード例 #5
0
 def test_bootstrapped_game_is_new(self):
     g = Game.new_game(name='test', user=self.user, player_name='storyteller')
     self.assertEqual(g.status, GameStatus.NEW)
コード例 #6
0
 def test_bootstrapped_game_has_player_and_round(self):
     g = Game.new_game(name='test', user=self.user, player_name='storyteller')
     self.assertEqual(g.players.count(), 1)
     self.assertTrue(g.current_round is not None)
コード例 #7
0
 def test_new_game_is_new(self):
     g = Game(name='test')
     self.assertEqual(g.status, GameStatus.NEW)