Discussion:
[Docutils-users] Test suite failure
David Bruchmann
2014-06-26 10:04:05 UTC
Permalink
Hello,

I've the same bug as http://sourceforge.net/p/docutils/bugs/243/ but can't
login in the moment to sourceforge.net.

Here are more details:
primary it's always the same 'fault' (4 times):


-: expected
+: output
- <link rel="stylesheet" href="/test.css" type="text/css" />"""
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />"""

Here is still my alltests.out:
------------------------------
Testing Docutils 0.11 [release] with Python 2.7.6 on 2014-06-26 at 16:13:05
Working directory: C:\Users\d_admin\Downloads\docutils-0.11\test
Docutils package: C:\Users\d_admin\Downloads\docutils-0.11\docutils

test_writers\test_html4css1_template.py: totest['template'][0]; test_publish
(DocutilsTestSupport.WriterPublishTestCase)
input:
================
Document Title
================
----------
Subtitle
----------

:Author: Me

.. footer:: footer text

Section
=======

Some text.

-: expected
+: output
head_prefix = """\
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>"""


head = """\
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.11:
http://docutils.sourceforge.net/" />
<title>Document Title</title>
<meta name="author" content="Me" />"""


stylesheet = """\
- <link rel="stylesheet" href="/test.css" type="text/css" />"""
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />"""
? ++


body_prefix = """\
</head>
<body>
<div class="document" id="document-title">"""


body_pre_docinfo = """\
<h1 class="title">Document Title</h1>
<h2 class="subtitle" id="subtitle">Subtitle</h2>"""


docinfo = """\
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Me</td></tr>
</tbody>
</table>"""


body = """\
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>"""


body_suffix = """\
</div>
<div class="footer">
<hr class="footer" />
footer text
</div>
</body>
</html>"""


head_prefix = """\
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>"""


head = """\
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.11:
http://docutils.sourceforge.net/" />
<title>Document Title</title>
<meta name="author" content="Me" />"""


stylesheet = """\
- <link rel="stylesheet" href="/test.css" type="text/css" />"""
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />"""
? ++


body_prefix = """\
</head>
<body>
<div class="document" id="document-title">"""


body_pre_docinfo = """\
<h1 class="title">Document Title</h1>
<h2 class="subtitle" id="subtitle">Subtitle</h2>"""


docinfo = """\
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Me</td></tr>
</tbody>
</table>"""


body = """\
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>"""


body_suffix = """\
</div>
<div class="footer">
<hr class="footer" />
footer text
</div>
</body>
</html>"""


title = """\
Document Title"""


subtitle = """\
Subtitle"""


header = """\
"""


footer = """\
<div class="footer">
<hr class="footer" />
footer text
</div>"""


meta = """\
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.11:
http://docutils.sourceforge.net/" />
<meta name="author" content="Me" />"""


fragment = """\
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>"""


html_prolog = """\
<?xml version="1.0" encoding="%s" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"""


html_head = """\
<meta http-equiv="Content-Type" content="text/html; charset=%s" />
<meta name="generator" content="Docutils 0.11:
http://docutils.sourceforge.net/" />
<title>Document Title</title>
<meta name="author" content="Me" />"""


html_title = """\
<h1 class="title">Document Title</h1>"""


html_subtitle = """\
<h2 class="subtitle" id="subtitle">Subtitle</h2>"""


html_body = """\
<div class="document" id="document-title">
<h1 class="title">Document Title</h1>
<h2 class="subtitle" id="subtitle">Subtitle</h2>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Me</td></tr>
</tbody>
</table>
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>
</div>
<div class="footer">
<hr class="footer" />
footer text
</div>"""

test_writers\test_s5.py: totest['basics'][0]; test_publish
(DocutilsTestSupport.WriterPublishTestCase)
input:
============
Show Title
============

Title slide

First Slide
===========

Slide text.

-: expected
+: output
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.11:
http://docutils.sourceforge.net/" />
<meta name="version" content="S5 1.1" />
<title>Show Title</title>
- <link rel="stylesheet" href="/test.css" type="text/css" />
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />
? ++
<!-- configuration parameters -->
<meta name="defaultView" content="slideshow" />
<meta name="controlVis" content="hidden" />
<!-- style sheet links -->
<script src="ui/default/slides.js" type="text/javascript"></script>
<link rel="stylesheet" href="ui/default/slides.css"
type="text/css" media="projection" id="slideProj" />
<link rel="stylesheet" href="ui/default/outline.css"
type="text/css" media="screen" id="outlineStyle" />
<link rel="stylesheet" href="ui/default/print.css"
type="text/css" media="print" id="slidePrint" />
<link rel="stylesheet" href="ui/default/opera.css"
type="text/css" media="projection" id="operaFix" />

<style type="text/css">
#currentSlide {display: none;}
</style>
</head>
<body>
<div class="layout">
<div id="controls"></div>
<div id="currentSlide"></div>
<div id="header">

</div>
<div id="footer">
<h1>Show Title</h1>

</div>
</div>
<div class="presentation">
<div class="slide" id="slide0">
<h1 class="title">Show Title</h1>

<p>Title slide</p>

</div>
<div class="slide" id="first-slide">
<h1>First Slide</h1>
<p>Slide text.</p>
</div>
</div>
</body>
</html>

test_writers\test_s5.py: totest['settings'][0]; test_publish
(DocutilsTestSupport.WriterPublishTestCase)
input:
==================
Bogus Slide Show
==================

We're just checking the settings

-: expected
+: output
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.11:
http://docutils.sourceforge.net/" />
<meta name="version" content="S5 1.1" />
<title>Bogus Slide Show</title>
- <link rel="stylesheet" href="/test.css" type="text/css" />
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />
? ++
<!-- configuration parameters -->
<meta name="defaultView" content="outline" />
<meta name="controlVis" content="visible" />
<!-- style sheet links -->
<script src="ui/default/slides.js" type="text/javascript"></script>
<link rel="stylesheet" href="ui/default/slides.css"
type="text/css" media="projection" id="slideProj" />
<link rel="stylesheet" href="ui/default/outline.css"
type="text/css" media="screen" id="outlineStyle" />
<link rel="stylesheet" href="ui/default/print.css"
type="text/css" media="print" id="slidePrint" />
<link rel="stylesheet" href="ui/default/opera.css"
type="text/css" media="projection" id="operaFix" />

<style type="text/css">
#currentSlide {display: none;}
</style>
</head>
<body>
<div class="layout">
<div id="controls"></div>
<div id="currentSlide"></div>
<div id="header">

</div>
<div id="footer">
<h1>Bogus Slide Show</h1>

</div>
</div>
<div class="presentation">
<div class="slide" id="slide0">
<h1 class="title">Bogus Slide Show</h1>

<p>We're just checking the settings</p>
</div>
</div>
</body>
</html>
Elapsed time: 57.993 seconds

------------------------------
engelbert gruber
2014-06-26 16:55:40 UTC
Permalink
thanks for mentioning

somehow this is in my workpile
but i do not know how to solve

ans therefore i am very interested opinions

facts (as i remember)

1. a configured stylesheet "/style.css" results in an absolute path
"c:/style.css" on windows.
2. a styleshhet inculding the drive letter only works for

- reading locally with the borwser
- only necessary if the stylesheet is on drive c: and the documents on
another dirv
otherwise the document would work without the drive letter
- in the theoretic case of a server templating system with a
postprocessor
removing the driveletter, before serving via http.

therefore i would opt for removing of the drive letter.
but the procedure prepending it is used all over docutils
and if someone specifies "f:/test.css" the driveletter must be left
untouched.
Post by David Bruchmann
Hello,
I've the same bug as http://sourceforge.net/p/docutils/bugs/243/ but can't
login in the moment to sourceforge.net.
-: expected
+: output
- <link rel="stylesheet" href="/test.css" type="text/css" />"""
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />"""
------------------------------
Testing Docutils 0.11 [release] with Python 2.7.6 on 2014-06-26 at 16:13:05
Working directory: C:\Users\d_admin\Downloads\docutils-0.11\test
Docutils package: C:\Users\d_admin\Downloads\docutils-0.11\docutils
test_writers\test_html4css1_template.py: totest['template'][0]; test_publish
(DocutilsTestSupport.WriterPublishTestCase)
================
Document Title
================
----------
Subtitle
----------
:Author: Me
.. footer:: footer text
Section
=======
Some text.
-: expected
+: output
head_prefix = """\
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>"""
head = """\
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
http://docutils.sourceforge.net/" />
<title>Document Title</title>
<meta name="author" content="Me" />"""
stylesheet = """\
- <link rel="stylesheet" href="/test.css" type="text/css" />"""
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />"""
? ++
body_prefix = """\
</head>
<body>
<div class="document" id="document-title">"""
body_pre_docinfo = """\
<h1 class="title">Document Title</h1>
<h2 class="subtitle" id="subtitle">Subtitle</h2>"""
docinfo = """\
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Me</td></tr>
</tbody>
</table>"""
body = """\
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>"""
body_suffix = """\
</div>
<div class="footer">
<hr class="footer" />
footer text
</div>
</body>
</html>"""
head_prefix = """\
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>"""
head = """\
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
http://docutils.sourceforge.net/" />
<title>Document Title</title>
<meta name="author" content="Me" />"""
stylesheet = """\
- <link rel="stylesheet" href="/test.css" type="text/css" />"""
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />"""
? ++
body_prefix = """\
</head>
<body>
<div class="document" id="document-title">"""
body_pre_docinfo = """\
<h1 class="title">Document Title</h1>
<h2 class="subtitle" id="subtitle">Subtitle</h2>"""
docinfo = """\
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Me</td></tr>
</tbody>
</table>"""
body = """\
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>"""
body_suffix = """\
</div>
<div class="footer">
<hr class="footer" />
footer text
</div>
</body>
</html>"""
title = """\
Document Title"""
subtitle = """\
Subtitle"""
header = """\
"""
footer = """\
<div class="footer">
<hr class="footer" />
footer text
</div>"""
meta = """\
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
http://docutils.sourceforge.net/" />
<meta name="author" content="Me" />"""
fragment = """\
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>"""
html_prolog = """\
<?xml version="1.0" encoding="%s" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"""
html_head = """\
<meta http-equiv="Content-Type" content="text/html; charset=%s" />
http://docutils.sourceforge.net/" />
<title>Document Title</title>
<meta name="author" content="Me" />"""
html_title = """\
<h1 class="title">Document Title</h1>"""
html_subtitle = """\
<h2 class="subtitle" id="subtitle">Subtitle</h2>"""
html_body = """\
<div class="document" id="document-title">
<h1 class="title">Document Title</h1>
<h2 class="subtitle" id="subtitle">Subtitle</h2>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Me</td></tr>
</tbody>
</table>
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>
</div>
<div class="footer">
<hr class="footer" />
footer text
</div>"""
test_writers\test_s5.py: totest['basics'][0]; test_publish
(DocutilsTestSupport.WriterPublishTestCase)
============
Show Title
============
Title slide
First Slide
===========
Slide text.
-: expected
+: output
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
http://docutils.sourceforge.net/" />
<meta name="version" content="S5 1.1" />
<title>Show Title</title>
- <link rel="stylesheet" href="/test.css" type="text/css" />
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />
? ++
<!-- configuration parameters -->
<meta name="defaultView" content="slideshow" />
<meta name="controlVis" content="hidden" />
<!-- style sheet links -->
<script src="ui/default/slides.js" type="text/javascript"></script>
<link rel="stylesheet" href="ui/default/slides.css"
type="text/css" media="projection" id="slideProj" />
<link rel="stylesheet" href="ui/default/outline.css"
type="text/css" media="screen" id="outlineStyle" />
<link rel="stylesheet" href="ui/default/print.css"
type="text/css" media="print" id="slidePrint" />
<link rel="stylesheet" href="ui/default/opera.css"
type="text/css" media="projection" id="operaFix" />
<style type="text/css">
#currentSlide {display: none;}
</style>
</head>
<body>
<div class="layout">
<div id="controls"></div>
<div id="currentSlide"></div>
<div id="header">
</div>
<div id="footer">
<h1>Show Title</h1>
</div>
</div>
<div class="presentation">
<div class="slide" id="slide0">
<h1 class="title">Show Title</h1>
<p>Title slide</p>
</div>
<div class="slide" id="first-slide">
<h1>First Slide</h1>
<p>Slide text.</p>
</div>
</div>
</body>
</html>
test_writers\test_s5.py: totest['settings'][0]; test_publish
(DocutilsTestSupport.WriterPublishTestCase)
==================
Bogus Slide Show
==================
We're just checking the settings
-: expected
+: output
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
http://docutils.sourceforge.net/" />
<meta name="version" content="S5 1.1" />
<title>Bogus Slide Show</title>
- <link rel="stylesheet" href="/test.css" type="text/css" />
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />
? ++
<!-- configuration parameters -->
<meta name="defaultView" content="outline" />
<meta name="controlVis" content="visible" />
<!-- style sheet links -->
<script src="ui/default/slides.js" type="text/javascript"></script>
<link rel="stylesheet" href="ui/default/slides.css"
type="text/css" media="projection" id="slideProj" />
<link rel="stylesheet" href="ui/default/outline.css"
type="text/css" media="screen" id="outlineStyle" />
<link rel="stylesheet" href="ui/default/print.css"
type="text/css" media="print" id="slidePrint" />
<link rel="stylesheet" href="ui/default/opera.css"
type="text/css" media="projection" id="operaFix" />
<style type="text/css">
#currentSlide {display: none;}
</style>
</head>
<body>
<div class="layout">
<div id="controls"></div>
<div id="currentSlide"></div>
<div id="header">
</div>
<div id="footer">
<h1>Bogus Slide Show</h1>
</div>
</div>
<div class="presentation">
<div class="slide" id="slide0">
<h1 class="title">Bogus Slide Show</h1>
<p>We're just checking the settings</p>
</div>
</div>
</body>
</html>
Elapsed time: 57.993 seconds
------------------------------
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Docutils-users mailing list
https://lists.sourceforge.net/lists/listinfo/docutils-users
Please use "Reply All" to reply to the list.
David Bruchmann
2014-06-26 17:17:52 UTC
Permalink
Hello Engelbert,

I know that a path like /mypath/ without "C:" works in Windows.
Nevertheless 'C:' can be seen as the root-folder of any directory in
comparison to linux.
Without drive-letter you can't access a file of another drive that's
the same as you try to access /home/myFile.txt which is resided in
/usr/myFile.txt.
Therefore the drive-letter should left untouched as you wrote.
In general the result is correct in my opinion.

I think the tests should be adjusted NOT to throw an error
I don't know how to adjust the expected value as I never had a look in
the source-code but that's secondary. Sense of the tests is not to
make a 100% string-comparison but to test if the values are correct
and work, right?

David
Post by engelbert gruber
thanks for mentioning
somehow this is in my workpile
but i do not know how to solve
ans therefore i am very interested opinions
facts (as i remember)
1. a configured stylesheet "/style.css" results in an absolute path
"c:/style.css" on windows.
2. a styleshhet inculding the drive letter only works for
- reading locally with the borwser
- only necessary if the stylesheet is on drive c: and the documents on
another dirv
otherwise the document would work without the drive letter
- in the theoretic case of a server templating system with a
postprocessor
removing the driveletter, before serving via http.
therefore i would opt for removing of the drive letter.
but the procedure prepending it is used all over docutils
and if someone specifies "f:/test.css" the driveletter must be left
untouched.
Post by David Bruchmann
Hello,
I've the same bug as http://sourceforge.net/p/docutils/bugs/243/ but can't
login in the moment to sourceforge.net.
-: expected
+: output
- <link rel="stylesheet" href="/test.css" type="text/css" />"""
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />"""
------------------------------
Testing Docutils 0.11 [release] with Python 2.7.6 on 2014-06-26 at 16:13:05
Working directory: C:\Users\d_admin\Downloads\docutils-0.11\test
Docutils package: C:\Users\d_admin\Downloads\docutils-0.11\docutils
test_writers\test_html4css1_template.py: totest['template'][0]; test_publish
(DocutilsTestSupport.WriterPublishTestCase)
================
Document Title
================
----------
Subtitle
----------
:Author: Me
.. footer:: footer text
Section
=======
Some text.
-: expected
+: output
head_prefix = """\
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>"""
head = """\
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
http://docutils.sourceforge.net/" />
<title>Document Title</title>
<meta name="author" content="Me" />"""
stylesheet = """\
- <link rel="stylesheet" href="/test.css" type="text/css" />"""
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />"""
? ++
body_prefix = """\
</head>
<body>
<div class="document" id="document-title">"""
body_pre_docinfo = """\
<h1 class="title">Document Title</h1>
<h2 class="subtitle" id="subtitle">Subtitle</h2>"""
docinfo = """\
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Me</td></tr>
</tbody>
</table>"""
body = """\
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>"""
body_suffix = """\
</div>
<div class="footer">
<hr class="footer" />
footer text
</div>
</body>
</html>"""
head_prefix = """\
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>"""
head = """\
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
http://docutils.sourceforge.net/" />
<title>Document Title</title>
<meta name="author" content="Me" />"""
stylesheet = """\
- <link rel="stylesheet" href="/test.css" type="text/css" />"""
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />"""
? ++
body_prefix = """\
</head>
<body>
<div class="document" id="document-title">"""
body_pre_docinfo = """\
<h1 class="title">Document Title</h1>
<h2 class="subtitle" id="subtitle">Subtitle</h2>"""
docinfo = """\
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Me</td></tr>
</tbody>
</table>"""
body = """\
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>"""
body_suffix = """\
</div>
<div class="footer">
<hr class="footer" />
footer text
</div>
</body>
</html>"""
title = """\
Document Title"""
subtitle = """\
Subtitle"""
header = """\
"""
footer = """\
<div class="footer">
<hr class="footer" />
footer text
</div>"""
meta = """\
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
http://docutils.sourceforge.net/" />
<meta name="author" content="Me" />"""
fragment = """\
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>"""
html_prolog = """\
<?xml version="1.0" encoding="%s" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"""
html_head = """\
<meta http-equiv="Content-Type" content="text/html; charset=%s" />
http://docutils.sourceforge.net/" />
<title>Document Title</title>
<meta name="author" content="Me" />"""
html_title = """\
<h1 class="title">Document Title</h1>"""
html_subtitle = """\
<h2 class="subtitle" id="subtitle">Subtitle</h2>"""
html_body = """\
<div class="document" id="document-title">
<h1 class="title">Document Title</h1>
<h2 class="subtitle" id="subtitle">Subtitle</h2>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Me</td></tr>
</tbody>
</table>
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>
</div>
<div class="footer">
<hr class="footer" />
footer text
</div>"""
test_writers\test_s5.py: totest['basics'][0]; test_publish
(DocutilsTestSupport.WriterPublishTestCase)
============
Show Title
============
Title slide
First Slide
===========
Slide text.
-: expected
+: output
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
http://docutils.sourceforge.net/" />
<meta name="version" content="S5 1.1" />
<title>Show Title</title>
- <link rel="stylesheet" href="/test.css" type="text/css" />
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />
? ++
<!-- configuration parameters -->
<meta name="defaultView" content="slideshow" />
<meta name="controlVis" content="hidden" />
<!-- style sheet links -->
<script src="ui/default/slides.js" type="text/javascript"></script>
<link rel="stylesheet" href="ui/default/slides.css"
type="text/css" media="projection" id="slideProj" />
<link rel="stylesheet" href="ui/default/outline.css"
type="text/css" media="screen" id="outlineStyle" />
<link rel="stylesheet" href="ui/default/print.css"
type="text/css" media="print" id="slidePrint" />
<link rel="stylesheet" href="ui/default/opera.css"
type="text/css" media="projection" id="operaFix" />
<style type="text/css">
#currentSlide {display: none;}
</style>
</head>
<body>
<div class="layout">
<div id="controls"></div>
<div id="currentSlide"></div>
<div id="header">
</div>
<div id="footer">
<h1>Show Title</h1>
</div>
</div>
<div class="presentation">
<div class="slide" id="slide0">
<h1 class="title">Show Title</h1>
<p>Title slide</p>
</div>
<div class="slide" id="first-slide">
<h1>First Slide</h1>
<p>Slide text.</p>
</div>
</div>
</body>
</html>
test_writers\test_s5.py: totest['settings'][0]; test_publish
(DocutilsTestSupport.WriterPublishTestCase)
==================
Bogus Slide Show
==================
We're just checking the settings
-: expected
+: output
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
http://docutils.sourceforge.net/" />
<meta name="version" content="S5 1.1" />
<title>Bogus Slide Show</title>
- <link rel="stylesheet" href="/test.css" type="text/css" />
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />
? ++
<!-- configuration parameters -->
<meta name="defaultView" content="outline" />
<meta name="controlVis" content="visible" />
<!-- style sheet links -->
<script src="ui/default/slides.js" type="text/javascript"></script>
<link rel="stylesheet" href="ui/default/slides.css"
type="text/css" media="projection" id="slideProj" />
<link rel="stylesheet" href="ui/default/outline.css"
type="text/css" media="screen" id="outlineStyle" />
<link rel="stylesheet" href="ui/default/print.css"
type="text/css" media="print" id="slidePrint" />
<link rel="stylesheet" href="ui/default/opera.css"
type="text/css" media="projection" id="operaFix" />
<style type="text/css">
#currentSlide {display: none;}
</style>
</head>
<body>
<div class="layout">
<div id="controls"></div>
<div id="currentSlide"></div>
<div id="header">
</div>
<div id="footer">
<h1>Bogus Slide Show</h1>
</div>
</div>
<div class="presentation">
<div class="slide" id="slide0">
<h1 class="title">Bogus Slide Show</h1>
<p>We're just checking the settings</p>
</div>
</div>
</body>
</html>
Elapsed time: 57.993 seconds
------------------------------
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Docutils-users mailing list
https://lists.sourceforge.net/lists/listinfo/docutils-users
Please use "Reply All" to reply to the list.
Pete Jemian
2014-06-26 17:30:42 UTC
Permalink
Isn't Windows a bit different in handling directories and disks?

/mypath/ starts at the root of the default disk

If your default disk is
C:, doesn't it point to C:/mypath/
F:, doesn't it point to F:/mypath/

Engelbert's rule 1 (below) does not describe this.

HTH,
Pete
Post by David Bruchmann
Hello Engelbert,
I know that a path like /mypath/ without "C:" works in Windows.
Nevertheless 'C:' can be seen as the root-folder of any directory in
comparison to linux.
Without drive-letter you can't access a file of another drive that's
the same as you try to access /home/myFile.txt which is resided in
/usr/myFile.txt.
Therefore the drive-letter should left untouched as you wrote.
In general the result is correct in my opinion.
I think the tests should be adjusted NOT to throw an error
I don't know how to adjust the expected value as I never had a look in
the source-code but that's secondary. Sense of the tests is not to
make a 100% string-comparison but to test if the values are correct
and work, right?
David
Post by engelbert gruber
thanks for mentioning
somehow this is in my workpile
but i do not know how to solve
ans therefore i am very interested opinions
facts (as i remember)
1. a configured stylesheet "/style.css" results in an absolute path
"c:/style.css" on windows.
2. a styleshhet inculding the drive letter only works for
- reading locally with the borwser
- only necessary if the stylesheet is on drive c: and the documents on
another dirv
otherwise the document would work without the drive letter
- in the theoretic case of a server templating system with a
postprocessor
removing the driveletter, before serving via http.
therefore i would opt for removing of the drive letter.
but the procedure prepending it is used all over docutils
and if someone specifies "f:/test.css" the driveletter must be left
untouched.
Post by David Bruchmann
Hello,
I've the same bug as http://sourceforge.net/p/docutils/bugs/243/ but can't
login in the moment to sourceforge.net.
-: expected
+: output
- <link rel="stylesheet" href="/test.css" type="text/css" />"""
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />"""
------------------------------
Testing Docutils 0.11 [release] with Python 2.7.6 on 2014-06-26 at 16:13:05
Working directory: C:\Users\d_admin\Downloads\docutils-0.11\test
Docutils package: C:\Users\d_admin\Downloads\docutils-0.11\docutils
test_writers\test_html4css1_template.py: totest['template'][0]; test_publish
(DocutilsTestSupport.WriterPublishTestCase)
================
Document Title
================
----------
Subtitle
----------
:Author: Me
.. footer:: footer text
Section
=======
Some text.
-: expected
+: output
head_prefix = """\
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>"""
head = """\
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
http://docutils.sourceforge.net/" />
<title>Document Title</title>
<meta name="author" content="Me" />"""
stylesheet = """\
- <link rel="stylesheet" href="/test.css" type="text/css" />"""
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />"""
? ++
body_prefix = """\
</head>
<body>
<div class="document" id="document-title">"""
body_pre_docinfo = """\
<h1 class="title">Document Title</h1>
<h2 class="subtitle" id="subtitle">Subtitle</h2>"""
docinfo = """\
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Me</td></tr>
</tbody>
</table>"""
body = """\
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>"""
body_suffix = """\
</div>
<div class="footer">
<hr class="footer" />
footer text
</div>
</body>
</html>"""
head_prefix = """\
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>"""
head = """\
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
http://docutils.sourceforge.net/" />
<title>Document Title</title>
<meta name="author" content="Me" />"""
stylesheet = """\
- <link rel="stylesheet" href="/test.css" type="text/css" />"""
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />"""
? ++
body_prefix = """\
</head>
<body>
<div class="document" id="document-title">"""
body_pre_docinfo = """\
<h1 class="title">Document Title</h1>
<h2 class="subtitle" id="subtitle">Subtitle</h2>"""
docinfo = """\
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Me</td></tr>
</tbody>
</table>"""
body = """\
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>"""
body_suffix = """\
</div>
<div class="footer">
<hr class="footer" />
footer text
</div>
</body>
</html>"""
title = """\
Document Title"""
subtitle = """\
Subtitle"""
header = """\
"""
footer = """\
<div class="footer">
<hr class="footer" />
footer text
</div>"""
meta = """\
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
http://docutils.sourceforge.net/" />
<meta name="author" content="Me" />"""
fragment = """\
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>"""
html_prolog = """\
<?xml version="1.0" encoding="%s" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"""
html_head = """\
<meta http-equiv="Content-Type" content="text/html; charset=%s" />
http://docutils.sourceforge.net/" />
<title>Document Title</title>
<meta name="author" content="Me" />"""
html_title = """\
<h1 class="title">Document Title</h1>"""
html_subtitle = """\
<h2 class="subtitle" id="subtitle">Subtitle</h2>"""
html_body = """\
<div class="document" id="document-title">
<h1 class="title">Document Title</h1>
<h2 class="subtitle" id="subtitle">Subtitle</h2>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Me</td></tr>
</tbody>
</table>
<div class="section" id="section">
<h1>Section</h1>
<p>Some text.</p>
</div>
</div>
<div class="footer">
<hr class="footer" />
footer text
</div>"""
test_writers\test_s5.py: totest['basics'][0]; test_publish
(DocutilsTestSupport.WriterPublishTestCase)
============
Show Title
============
Title slide
First Slide
===========
Slide text.
-: expected
+: output
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
http://docutils.sourceforge.net/" />
<meta name="version" content="S5 1.1" />
<title>Show Title</title>
- <link rel="stylesheet" href="/test.css" type="text/css" />
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />
? ++
<!-- configuration parameters -->
<meta name="defaultView" content="slideshow" />
<meta name="controlVis" content="hidden" />
<!-- style sheet links -->
<script src="ui/default/slides.js" type="text/javascript"></script>
<link rel="stylesheet" href="ui/default/slides.css"
type="text/css" media="projection" id="slideProj" />
<link rel="stylesheet" href="ui/default/outline.css"
type="text/css" media="screen" id="outlineStyle" />
<link rel="stylesheet" href="ui/default/print.css"
type="text/css" media="print" id="slidePrint" />
<link rel="stylesheet" href="ui/default/opera.css"
type="text/css" media="projection" id="operaFix" />
<style type="text/css">
#currentSlide {display: none;}
</style>
</head>
<body>
<div class="layout">
<div id="controls"></div>
<div id="currentSlide"></div>
<div id="header">
</div>
<div id="footer">
<h1>Show Title</h1>
</div>
</div>
<div class="presentation">
<div class="slide" id="slide0">
<h1 class="title">Show Title</h1>
<p>Title slide</p>
</div>
<div class="slide" id="first-slide">
<h1>First Slide</h1>
<p>Slide text.</p>
</div>
</div>
</body>
</html>
test_writers\test_s5.py: totest['settings'][0]; test_publish
(DocutilsTestSupport.WriterPublishTestCase)
==================
Bogus Slide Show
==================
We're just checking the settings
-: expected
+: output
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
http://docutils.sourceforge.net/" />
<meta name="version" content="S5 1.1" />
<title>Bogus Slide Show</title>
- <link rel="stylesheet" href="/test.css" type="text/css" />
+ <link rel="stylesheet" href="C:/test.css" type="text/css" />
? ++
<!-- configuration parameters -->
<meta name="defaultView" content="outline" />
<meta name="controlVis" content="visible" />
<!-- style sheet links -->
<script src="ui/default/slides.js" type="text/javascript"></script>
<link rel="stylesheet" href="ui/default/slides.css"
type="text/css" media="projection" id="slideProj" />
<link rel="stylesheet" href="ui/default/outline.css"
type="text/css" media="screen" id="outlineStyle" />
<link rel="stylesheet" href="ui/default/print.css"
type="text/css" media="print" id="slidePrint" />
<link rel="stylesheet" href="ui/default/opera.css"
type="text/css" media="projection" id="operaFix" />
<style type="text/css">
#currentSlide {display: none;}
</style>
</head>
<body>
<div class="layout">
<div id="controls"></div>
<div id="currentSlide"></div>
<div id="header">
</div>
<div id="footer">
<h1>Bogus Slide Show</h1>
</div>
</div>
<div class="presentation">
<div class="slide" id="slide0">
<h1 class="title">Bogus Slide Show</h1>
<p>We're just checking the settings</p>
</div>
</div>
</body>
</html>
Elapsed time: 57.993 seconds
------------------------------
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Docutils-users mailing list
https://lists.sourceforge.net/lists/listinfo/docutils-users
Please use "Reply All" to reply to the list.
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Docutils-users mailing list
https://lists.sourceforge.net/lists/listinfo/docutils-users
Please use "Reply All" to reply to the list.
--
----------------------------------------------------------
Pete R. Jemian, Ph.D. <***@anl.gov>
Beam line Controls and Data Acquisition, Group Leader
Advanced Photon Source, Argonne National Laboratory
Argonne, IL 60439 630 - 252 - 3189
-----------------------------------------------------------
Education is the one thing for which people
are willing to pay yet not receive.
-----------------------------------------------------------
David Bruchmann
2014-06-26 18:32:02 UTC
Permalink
- distributing a document generated on a not "C:" drive would make the
stylesheet path
wrong on most other machines, for sure on any unix(mac/linux
That argument is reasonable.

Apart from that you've just to deal with the fact that the 4 errors
are thrown on Windows when using absolute paths.
Relative paths could be a solution but maybe that's sometimes not desired.
I suppose you can solve the problem only with a configuration-option
where every user can decide. You still can recommend one solution.

Btw I built the tests from a subdirectory and not directly in C:\, so
the value would be wrong, no matter if "C:/test.css" or "/test.css".
In my opinion here it would be reasonable to built the paths really
relative.

David

Loading...