def test_make_move10(self): """ Tests making a black move to the SW. """ g = GessGame() self.assertTrue(g.make_move('m8', 'l7'))
def test_make_move4(self): """ Tests completing a successful move. """ g = GessGame() self.assertFalse(g.make_move('c7', 'c8'))
def test_make_move9(self): """ Tests making a black move to the E. """ g = GessGame() self.assertTrue(g.make_move('k7', 'l7'))
def test_make_move2(self): """ Tests handling an illegal move. """ g = GessGame() self.assertFalse(g.make_move('c6', 'd7'))
def test_make_move3(self): """ Tests destroying the last ring as the active player. """ g = GessGame() self.assertFalse(g.make_move('j3', 'j5'))
def test_check_win_condition4(self): """ Tests a natural win for the white player. """ g = GessGame() g.make_move('f6', 'f9') # black move g.make_move('l15', 'l12') # white move g.make_move('f9', 'f12') # black move g.make_move('l12', 'l9') # white move g.make_move('f12', 'f13') # black move g.make_move('l9', 'l8') # white move g.make_move('f15', 'f14') # black move g.make_move('l8', 'l5') # white move self.assertEqual('WHITE_WON', g.game_state)
def test_check_win_condition3(self): """ Tests a natural win for the black player. """ g = GessGame() g.make_move('l6', 'l9') # black move g.make_move('c15', 'c12') # white move g.make_move('l9', 'l12') # black move g.make_move('c12', 'c9') # white move g.make_move('l12', 'l13') # black move g.make_move('c9', 'c8') # white move g.make_move('l13', 'l16') # black move self.assertEqual('BLACK_WON', g.game_state)
def test_make_move1(self): """ Tests trying to make a move after the game is finished. """ g = GessGame() g.make_move('f6', 'f9') # black move g.make_move('l15', 'l12') # white move g.make_move('f9', 'f12') # black move g.make_move('l12', 'l9') # white move g.make_move('f12', 'f13') # black move g.make_move('l9', 'l8') # white move g.make_move('f15', 'f14') # black move g.make_move('l8', 'l5') # white move response = g.make_move('f14', 'f13') self.assertFalse(response)
def test_make_move20(self): """ Tests making a white move to the SE. """ g = GessGame() g.make_move('k8', 'l7') self.assertTrue(g.make_move('b15', 'c14'))
def test_make_move16(self): """ Tests making a white move to the W. """ g = GessGame() g.make_move('k8', 'l7') self.assertTrue(g.make_move('d14', 'c14'))