def test_iswon(self): sboard = Cb.getstartingboard() # no win rboard = Cb.getemptyboard() bboard = Cb.getemptyboard() rboard[0] = RED # red win bboard[0] = BLACK # black win self.assertEqual(Cb.iswon(sboard), NOWIN) # checks self.assertEqual(Cb.iswon(rboard), REDWON) self.assertEqual(Cb.iswon(bboard), BLACKWON)
def test_getemptyboard(self): board = Cb.getemptyboard() self.assertEqual(len(board), 32) # size of board self.assertEqual(board.count(EMPTY), 32) # number of empty tiles