def test_AI_move_empty(self): """Test the AI placing a move on an empty board""" b = Board() b.spaces = ' ' self.assertIn(_AI_move_random(b), range(9))
def test_AI_move_middle_of_game(self): """Test the AI placing a move on a partially-filled board""" b = Board() b.spaces = 'XXO X O ' self.assertIn(_AI_move_random(b), [3, 5, 6, 8])
def test_AI_move_full(self): """Test the AI trying to move on a full board""" b = Board() b.spaces = 'XXOOOXXOX' self.assertIsNone(_AI_move_random(b))