Esempio n. 1
0
 def test_register_guess_in_hall(self):
     g = Game()
     g.add_player(u"Test2", u"Miss Scarlett")
     g._active_move = u"guess"
     g._active_player = u"Test2"
     with pytest.raises(IllegalGuess):
         g.register_guess(u"Test2", u"Mr. Green", u"study", u"candlestick")
Esempio n. 2
0
 def set_up_to_player_gb(self):
     g = Game()
     g.add_player(u"Test1", u"Prof. Plum")
     g.add_player(u"Test2", u"Miss Scarlett")
     g._active_player = u"Test2"
     g._gameboard.enter_room(u"Miss Scarlett", 2)
     return g
Esempio n. 3
0
 def test_register_guess_wrong_room(self):
     g = Game()
     g.add_player(u"Test2", u"Miss Scarlett")
     g._active_player = u"Test2"
     g._gameboard.enter_room(u"Miss Scarlett", 2)
     g._active_move = u"guess"
     with pytest.raises(IllegalGuess):
         g.register_guess(u"Test2", u"Mr. Green", u"lounge", u"candlestick")
Esempio n. 4
0
 def test_prepare_move(self):
     g = Game()
     g.add_player(u"Test1", u"Col. Mustard")
     g._active_player = u"Test1"
     g.prepare_move()
     assert (g._active_move == u"move")
     assert (g._dice[0] in range(1, 7))
     assert (g._dice[1] in range(1, 7))
Esempio n. 5
0
 def test_register_good_guess(self):
     g = Game()
     g.add_player(u"Test1", u"Prof. Plum")
     g.add_player(u"Test2", u"Miss Scarlett")
     g._active_player = u"Test2"
     g._gameboard.enter_room(u"Miss Scarlett", 2)
     g._active_move = u"guess"
     g.register_guess(u"Test2", u"Mr. Green", u"study", u"candlestick")
     assert (isinstance(g._guess, Guess))
     assert (g._guess._guess_order[0].get_playername() == u"Test1")
Esempio n. 6
0
 def set_up_full_gb(self):
     g = Game()
     g.add_player(u"Test1", u"Prof. Plum")
     g.add_player(u"Test2", u"Miss Scarlett")
     g.add_player(u"Test3", u"Mrs. White")
     g.add_player(u"Test4", u"Mr. Green")
     g.add_player(u"Test5", u"Col. Mustard")
     g.add_player(u"Test6", u"Mrs. Peacock")
     g._active_player = u"Test2"
     g._gameboard.enter_room(u"Miss Scarlett", 2)
     return g
Esempio n. 7
0
 def test_register_guess_wrong_player(self):
     g = Game()
     g._active_move = u"guess"
     g._active_player = u"Test2"
     with pytest.raises(IllegalCommand):
         g.register_guess(u"Test1", u"Mr. Green", u"study", u"candlestick")
Esempio n. 8
0
 def test_get_room_active_mob(self):
     g = Game()
     g.add_player(u"Test2", u"Miss Scarlett")
     g._active_player = u"Test2"
     g._gameboard.enter_room(u"Miss Scarlett", 4)
     assert (g.get_active_room() == u"lounge")