@@ -83,6 +83,194 @@ def test_quote(self):
8383 if ":author: auteur" not in rst :
8484 raise Exception (rst )
8585
86+ def test_quote_manga (self ):
87+ from docutils import nodes as skip_
88+
89+ content = """
90+ .. quote::
91+ :author: auteur
92+ :manga: manga titre
93+ :lid: label1
94+ :pages: 234
95+ :year: 2018
96+
97+ this code should appear___
98+
99+ next
100+ """ .replace (" " , "" )
101+ if sys .version_info [0 ] >= 3 :
102+ content = content .replace ('u"' , '"' )
103+
104+ tives = [("quote" , QuoteNode , quote_node ,
105+ visit_quote_node , depart_quote_node )]
106+
107+ html = rst2html (content , # fLOG=fLOG,
108+ writer = "html" , keep_warnings = True ,
109+ directives = tives , extlinks = {'issue' : ('http://%s' , '_issue_' )})
110+
111+ temp = get_temp_folder (__file__ , "temp_quote_manga" , clean = False )
112+ with open (os .path .join (temp , "test_quote_manga.html" ), "w" , encoding = "utf8" ) as f :
113+ f .write (html )
114+
115+ t1 = "this code should appear"
116+ if t1 not in html :
117+ raise Exception (html )
118+ if "auteur" not in html :
119+ raise Exception (html )
120+ if "manga titre" not in html :
121+ raise Exception (html )
122+ if "234" not in html :
123+ raise Exception (html )
124+
125+ tives = [("quote" , QuoteNode , quote_node ,
126+ visit_quote_node_rst , depart_quote_node_rst )]
127+
128+ rst = rst2html (content , # fLOG=fLOG,
129+ writer = "rst" , keep_warnings = True ,
130+ directives = tives , extlinks = {'issue' : ('http://%s' , '_issue_' )})
131+
132+ with open (os .path .join (temp , "test_quote_manga.rst" ), "w" , encoding = "utf8" ) as f :
133+ f .write (rst )
134+
135+ t1 = "this code should appear"
136+ if t1 not in rst :
137+ raise Exception (rst )
138+ if "auteur" not in rst :
139+ raise Exception (rst )
140+ if "manga titre" not in rst :
141+ raise Exception (rst )
142+ if "234" not in rst :
143+ raise Exception (rst )
144+ if ".. quote::" not in rst :
145+ raise Exception (rst )
146+ if ":author: auteur" not in rst :
147+ raise Exception (rst )
148+
149+ def test_quote_film (self ):
150+ from docutils import nodes as skip_
151+
152+ content = """
153+ .. quote::
154+ :author: auteur
155+ :film: film titre
156+ :lid: label1
157+ :pages: 234
158+ :year: 2018
159+
160+ this code should appear___
161+
162+ next
163+ """ .replace (" " , "" )
164+ if sys .version_info [0 ] >= 3 :
165+ content = content .replace ('u"' , '"' )
166+
167+ tives = [("quote" , QuoteNode , quote_node ,
168+ visit_quote_node , depart_quote_node )]
169+
170+ html = rst2html (content , # fLOG=fLOG,
171+ writer = "html" , keep_warnings = True ,
172+ directives = tives , extlinks = {'issue' : ('http://%s' , '_issue_' )})
173+
174+ temp = get_temp_folder (__file__ , "temp_quote_film" , clean = False )
175+ with open (os .path .join (temp , "test_quote_film.html" ), "w" , encoding = "utf8" ) as f :
176+ f .write (html )
177+
178+ t1 = "this code should appear"
179+ if t1 not in html :
180+ raise Exception (html )
181+ if "auteur" not in html :
182+ raise Exception (html )
183+ if "film titre" not in html :
184+ raise Exception (html )
185+ if "234" not in html :
186+ raise Exception (html )
187+
188+ tives = [("quote" , QuoteNode , quote_node ,
189+ visit_quote_node_rst , depart_quote_node_rst )]
190+
191+ rst = rst2html (content , # fLOG=fLOG,
192+ writer = "rst" , keep_warnings = True ,
193+ directives = tives , extlinks = {'issue' : ('http://%s' , '_issue_' )})
194+
195+ with open (os .path .join (temp , "test_quote_film.rst" ), "w" , encoding = "utf8" ) as f :
196+ f .write (rst )
197+
198+ t1 = "this code should appear"
199+ if t1 not in rst :
200+ raise Exception (rst )
201+ if "auteur" not in rst :
202+ raise Exception (rst )
203+ if "film titre" not in rst :
204+ raise Exception (rst )
205+ if "234" not in rst :
206+ raise Exception (rst )
207+ if ".. quote::" not in rst :
208+ raise Exception (rst )
209+ if ":author: auteur" not in rst :
210+ raise Exception (rst )
211+
212+ def test_quote_show (self ):
213+ from docutils import nodes as skip_
214+
215+ content = """
216+ .. quote::
217+ :author: auteur
218+ :show: show titre
219+ :lid: label1
220+ :pages: 234
221+ :year: 2018
222+
223+ this code should appear___
224+
225+ next
226+ """ .replace (" " , "" )
227+ if sys .version_info [0 ] >= 3 :
228+ content = content .replace ('u"' , '"' )
229+
230+ tives = [("quote" , QuoteNode , quote_node ,
231+ visit_quote_node , depart_quote_node )]
232+
233+ html = rst2html (content , # fLOG=fLOG,
234+ writer = "html" , keep_warnings = True ,
235+ directives = tives , extlinks = {'issue' : ('http://%s' , '_issue_' )})
236+
237+ temp = get_temp_folder (__file__ , "temp_quote_show" , clean = False )
238+ with open (os .path .join (temp , "test_quote_show.html" ), "w" , encoding = "utf8" ) as f :
239+ f .write (html )
240+
241+ t1 = "this code should appear"
242+ if t1 not in html :
243+ raise Exception (html )
244+ if "auteur" not in html :
245+ raise Exception (html )
246+ if "show titre" not in html :
247+ raise Exception (html )
248+ if "234" not in html :
249+ raise Exception (html )
250+
251+ tives = [("quote" , QuoteNode , quote_node ,
252+ visit_quote_node_rst , depart_quote_node_rst )]
253+
254+ rst = rst2html (content , # fLOG=fLOG,
255+ writer = "rst" , keep_warnings = True ,
256+ directives = tives , extlinks = {'issue' : ('http://%s' , '_issue_' )})
257+
258+ with open (os .path .join (temp , "test_quote_show.rst" ), "w" , encoding = "utf8" ) as f :
259+ f .write (rst )
260+
261+ t1 = "this code should appear"
262+ if t1 not in rst :
263+ raise Exception (rst )
264+ if "auteur" not in rst :
265+ raise Exception (rst )
266+ if "show titre" not in rst :
267+ raise Exception (rst )
268+ if "234" not in rst :
269+ raise Exception (rst )
270+ if ".. quote::" not in rst :
271+ raise Exception (rst )
272+ if ":author: auteur" not in rst :
273+ raise Exception (rst )
86274
87275if __name__ == "__main__" :
88276 unittest .main ()
0 commit comments