Esempio n. 1
0
 def test_start_game(self):
     g = Game()
     g.add_player(u"Test1", u"Mrs. White")
     g.add_player(u"Test2", u"Mr. Green")
     g.start_game()
     assert (g._active_player == u"Test1")
     assert (g._active_move == u"move")
Esempio n. 2
0
 def test_move(self):
     g = Game()
     g.add_player(u"Test1", u"Prof. Plum")
     g.add_player(u"Test2", u"Miss Scarlett")
     with pytest.raises(IllegalCommand):
         g.move(u"Test1", u"right")
     g.start_game()
     with pytest.raises(IllegalCommand):
         g.move(u"Test2", u"up")
     assert (g.move(u"Test1", u"right") == True)
Esempio n. 3
0
 def test_finish_movement_onboard(self):
     g = Game()
     g.add_player(u"Test1", u"Prof. Plum")
     g.add_player(u"Test2", u"Miss Scarlett")
     g.start_game()
     g.set_number_of_moves_for_active_player(2)
     assert (g._active_move == u"move")
     assert (g.move(u"Test1", u"right") == True)
     assert (g.move(u"Test1", u"right") == True)
     with pytest.raises(IllegalCommand):
         g.move(u"Test1", u"right")
     assert (g._active_move == u"move")
     assert (g._active_player == u"Test2")