Fix: version number in headers
[docutils.git] / test / test_writers / test_s5.py
blob7bf7d17fe0539beeb33a26d325cc49703a2831a6
1 #!/usr/bin/env python
3 # $Id$
4 # Author: David Goodger <goodger@python.org>
5 # Copyright: This module has been placed in the public domain.
7 """
8 Tests for the S5/HTML writer.
9 """
11 import os
12 from __init__ import DocutilsTestSupport
15 def suite():
16 settings = {'embed_stylesheet': 0,}
17 s = DocutilsTestSupport.PublishTestSuite('s5', suite_settings=settings)
18 s.generateTests(totest_1)
19 settings['hidden_controls'] = 0
20 settings['view_mode'] = 'outline'
21 s.generateTests(totest_2)
22 return s
24 totest_1 = {}
25 totest_2 = {}
27 totest_1['basics'] = [
28 ["""\
29 ============
30 Show Title
31 ============
33 Title slide
35 First Slide
36 ===========
38 Slide text.
39 """,
40 """\
41 <?xml version="1.0" encoding="utf-8" ?>
42 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
43 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
44 <head>
45 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
46 <meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/" />
47 <meta name="version" content="S5 1.1" />
48 <title>Show Title</title>
49 <link rel="stylesheet" href="../docutils/writers/html4css1/html4css1.css" type="text/css" />
50 <!-- configuration parameters -->
51 <meta name="defaultView" content="slideshow" />
52 <meta name="controlVis" content="hidden" />
53 <!-- style sheet links -->
54 <script src="ui/default/slides.js" type="text/javascript"></script>
55 <link rel="stylesheet" href="ui/default/slides.css"
56 type="text/css" media="projection" id="slideProj" />
57 <link rel="stylesheet" href="ui/default/outline.css"
58 type="text/css" media="screen" id="outlineStyle" />
59 <link rel="stylesheet" href="ui/default/print.css"
60 type="text/css" media="print" id="slidePrint" />
61 <link rel="stylesheet" href="ui/default/opera.css"
62 type="text/css" media="projection" id="operaFix" />
64 <style type="text/css">
65 #currentSlide {display: none;}
66 </style>
67 </head>
68 <body>
69 <div class="layout">
70 <div id="controls"></div>
71 <div id="currentSlide"></div>
72 <div id="header">
74 </div>
75 <div id="footer">
76 <h1>Show Title</h1>
78 </div>
79 </div>
80 <div class="presentation">
81 <div class="slide" id="slide0">
82 <h1 class="title">Show Title</h1>
84 <p>Title slide</p>
86 </div>
87 <div class="slide" id="first-slide">
88 <h1>First Slide</h1>
89 <p>Slide text.</p>
90 </div>
91 </div>
92 </body>
93 </html>
94 """]
97 totest_2['settings'] = [
98 ["""\
99 ==================
100 Bogus Slide Show
101 ==================
103 We're just checking the settings
104 """,
105 """\
106 <?xml version="1.0" encoding="utf-8" ?>
107 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
108 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
109 <head>
110 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
111 <meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/" />
112 <meta name="version" content="S5 1.1" />
113 <title>Bogus Slide Show</title>
114 <link rel="stylesheet" href="../docutils/writers/html4css1/html4css1.css" type="text/css" />
115 <!-- configuration parameters -->
116 <meta name="defaultView" content="outline" />
117 <meta name="controlVis" content="visible" />
118 <!-- style sheet links -->
119 <script src="ui/default/slides.js" type="text/javascript"></script>
120 <link rel="stylesheet" href="ui/default/slides.css"
121 type="text/css" media="projection" id="slideProj" />
122 <link rel="stylesheet" href="ui/default/outline.css"
123 type="text/css" media="screen" id="outlineStyle" />
124 <link rel="stylesheet" href="ui/default/print.css"
125 type="text/css" media="print" id="slidePrint" />
126 <link rel="stylesheet" href="ui/default/opera.css"
127 type="text/css" media="projection" id="operaFix" />
129 <style type="text/css">
130 #currentSlide {display: none;}
131 </style>
132 </head>
133 <body>
134 <div class="layout">
135 <div id="controls"></div>
136 <div id="currentSlide"></div>
137 <div id="header">
139 </div>
140 <div id="footer">
141 <h1>Bogus Slide Show</h1>
143 </div>
144 </div>
145 <div class="presentation">
146 <div class="slide" id="slide0">
147 <h1 class="title">Bogus Slide Show</h1>
149 <p>We're just checking the settings</p>
150 </div>
151 </div>
152 </body>
153 </html>
154 """]
157 if __name__ == '__main__':
158 import unittest
159 unittest.main(defaultTest='suite')