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")
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")
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")
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")