def test_error_in_parsing(self): """ Обработка неверного файла """ parser = SgfParser() sgf = "This is not sgf" with self.assertRaises(ValueError): parser.load_game_from_string(sgf)
def test_unsupported_game(self): sgf = "(;FF[4]C[root]GM[2])" with self.assertRaises(UnsupportedGameException): parser = SgfParser() parser.load_game_from_string(sgf)
def load_root_node(self, sgf): parser = SgfParser() game = parser.load_game_from_string(sgf) return game.root