SF.net SVN: docutils:[9882] trunk/docutils/test/test_writers/ test_html5_polyglot_parts.py
milde--- via Docutils-checkins <[email protected]>
| Newsgroups | gmane.text.docutils.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 9882
http://sourceforge.net/p/docutils/code/9882
Author: milde
Date: 2024-08-11 07:18:41 +0000 (Sun, 11 Aug 2024)
Log Message:
-----------
Fixup [r9880]. Use `to_uri()` to get image URI in test sample.
Suggested by Adam Turner in [bugs.#493].
This should produce a correct "file:" URI under both, Unix and Windows.
Modified Paths:
--------------
trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
Modified: trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2024-08-10 08:12:14 UTC (rev 9881)
+++ trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2024-08-11 07:18:41 UTC (rev 9882)
@@ -36,7 +36,7 @@
# TEST_ROOT is ./test/ from the docutils root
TEST_ROOT = Path(__file__).parents[1]
-DATA_ROOT = (TEST_ROOT / 'data').as_posix()
+DATA_ROOT = TEST_ROOT / 'data'
ROOT_PREFIX = (TEST_ROOT / 'functional/input').as_posix()
# Pillow/PIL is optional:
@@ -721,7 +721,7 @@
""",
],
[f"""\
-.. image:: file://{DATA_ROOT}/circle-broken.svg
+.. image:: {DATA_ROOT.as_uri()}/circle-broken.svg
:loading: embed
""",
f"""\
@@ -732,7 +732,7 @@
<aside class="system-message">
<p class="system-message-title">System Message: ERROR/3 (<span class="docutils literal"><string></span>, line 1)</p>
-<p>Cannot parse SVG image "file://{DATA_ROOT}/circle-broken.svg":
+<p>Cannot parse SVG image "{DATA_ROOT.as_uri()}/circle-broken.svg":
not well-formed (invalid token): line 3, column 48</p>
</aside>
"""
@@ -838,7 +838,7 @@
""",
],
[f"""\
-.. image:: file://{DATA_ROOT}/circle-broken.svg
+.. image:: {DATA_ROOT.as_uri()}/circle-broken.svg
:loading: embed
""",
"""\
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.