#! /usr/bin/env python3
# $Id: test_html4css1_parts.py 10005 2024-12-18 22:03:27Z milde $
# Author: reggie dugard
# Maintainer: docutils-develop@lists.sourceforge.net
# Copyright: This module has been placed in the public domain.
"""
Test `core.publish_parts()`__ with the html4css1 writer.
__ https://docutils.sourceforge.io/docs/api/publisher.html#publish-parts
"""
from pathlib import Path
import sys
import unittest
if __name__ == '__main__':
# prepend the "docutils root" to the Python library path
# so we import the local `docutils` package.
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
import docutils
import docutils.core
from docutils.writers import html4css1
# TEST_ROOT is ./test/ from the docutils root
TEST_ROOT = Path(__file__).parents[1]
DATA_ROOT = TEST_ROOT / 'data'
ROOT_PREFIX = (TEST_ROOT / 'functional/input').as_posix()
# Parts returned by `publish_parts()` for the HTML5 writer by default:
# * empty input string
# * default configuration settings.
# See format_parts() below for the substitution of unresolved format markers.
default_parts = {
'body': '{fragment}',
'body_pre_docinfo': '',
'body_prefix': '\n\n{header}\n',
'body_suffix': '
\n{footer}\n