from unittest import TestCase from go.core import isLegalPosition class TestLegal(TestCase): def testLegal(self): board=[ [0,0,0,0,0], [1,1,1,1,1], [-1,-1,0,1,0], [0,0,0,-1,-1], [0,-1,0,-1,0] ] self.assertTrue(isLegalPosition(board)) def testIllegal(self): board=[ [0,1,0,0,0], [1,-1,1,0,0], [0,1,0,0,0], [0,0,0,0,0], [0,0,0,0,0] ] self.assertFalse(isLegalPosition(board))