Exemple #1
0
 def test_drop_piece_returns_final_position(self):
     g = Game() # 6x7 by default
     self.assertEquals(g._drop_piece('X', 0), (0,5))
     self.assertEquals(g._drop_piece('X', 0), (0,4))
     self.assertEquals(g._drop_piece('X', 0), (0,3))
     self.assertEquals(g._drop_piece('O', 0), (0,2))
     self.assertEquals(g._drop_piece('X', 0), (0,1))
     self.assertEquals(g._drop_piece('X', 0), (0,0))
Exemple #2
0
 def test_drop_piece_on_full_column_raises(self):
     g = Game(rows=2)
     self.assertEquals(g._drop_piece('X', 0), (0,1))
     self.assertEquals(g._drop_piece('X', 0), (0,0))
     self.assertRaises(ColumnFullException, g._drop_piece, 'X', 0)