##// END OF EJS Templates
Updated latex exporter tests
Jonathan Frederic -
Show More
@@ -1,68 +1,68 b''
1 """
1 """
2 Module with tests for latex.py
2 Module with tests for latex.py
3 """
3 """
4
4
5 #-----------------------------------------------------------------------------
5 #-----------------------------------------------------------------------------
6 # Copyright (c) 2013, the IPython Development Team.
6 # Copyright (c) 2013, the IPython Development Team.
7 #
7 #
8 # Distributed under the terms of the Modified BSD License.
8 # Distributed under the terms of the Modified BSD License.
9 #
9 #
10 # The full license is in the file COPYING.txt, distributed with this software.
10 # The full license is in the file COPYING.txt, distributed with this software.
11 #-----------------------------------------------------------------------------
11 #-----------------------------------------------------------------------------
12
12
13 #-----------------------------------------------------------------------------
13 #-----------------------------------------------------------------------------
14 # Imports
14 # Imports
15 #-----------------------------------------------------------------------------
15 #-----------------------------------------------------------------------------
16
16
17 from .base import ExportersTestsBase
17 from .base import ExportersTestsBase
18 from ..latex import LatexExporter
18 from ..latex import LatexExporter
19 from IPython.testing.decorators import onlyif_cmds_exist
19 from IPython.testing.decorators import onlyif_cmds_exist
20
20
21 #-----------------------------------------------------------------------------
21 #-----------------------------------------------------------------------------
22 # Class
22 # Class
23 #-----------------------------------------------------------------------------
23 #-----------------------------------------------------------------------------
24
24
25 class TestLatexExporter(ExportersTestsBase):
25 class TestLatexExporter(ExportersTestsBase):
26 """Contains test functions for latex.py"""
26 """Contains test functions for latex.py"""
27
27
28 def test_constructor(self):
28 def test_constructor(self):
29 """
29 """
30 Can a LatexExporter be constructed?
30 Can a LatexExporter be constructed?
31 """
31 """
32 LatexExporter()
32 LatexExporter()
33
33
34
34
35 @onlyif_cmds_exist('pandoc')
35 @onlyif_cmds_exist('pandoc')
36 def test_export(self):
36 def test_export(self):
37 """
37 """
38 Can a LatexExporter export something?
38 Can a LatexExporter export something?
39 """
39 """
40 (output, resources) = LatexExporter().from_filename(self._get_notebook())
40 (output, resources) = LatexExporter().from_filename(self._get_notebook())
41 assert len(output) > 0
41 assert len(output) > 0
42
42
43
43
44 @onlyif_cmds_exist('pandoc')
44 @onlyif_cmds_exist('pandoc')
45 def test_export_book(self):
45 def test_export_book(self):
46 """
46 """
47 Can a LatexExporter export using 'book' template?
47 Can a LatexExporter export using 'book' template?
48 """
48 """
49 (output, resources) = LatexExporter(template_file='book').from_filename(self._get_notebook())
49 (output, resources) = LatexExporter(template_file='book').from_filename(self._get_notebook())
50 assert len(output) > 0
50 assert len(output) > 0
51
51
52
52
53 @onlyif_cmds_exist('pandoc')
53 @onlyif_cmds_exist('pandoc')
54 def test_export_basic(self):
54 def test_export_basic(self):
55 """
55 """
56 Can a LatexExporter export using 'basic' template?
56 Can a LatexExporter export using 'article' template?
57 """
57 """
58 (output, resources) = LatexExporter(template_file='basic').from_filename(self._get_notebook())
58 (output, resources) = LatexExporter(template_file='article').from_filename(self._get_notebook())
59 assert len(output) > 0
59 assert len(output) > 0
60
60
61
61
62 @onlyif_cmds_exist('pandoc')
62 @onlyif_cmds_exist('pandoc')
63 def test_export_article(self):
63 def test_export_article(self):
64 """
64 """
65 Can a LatexExporter export using 'article' template?
65 Can a LatexExporter export using 'article' template?
66 """
66 """
67 (output, resources) = LatexExporter(template_file='article').from_filename(self._get_notebook())
67 (output, resources) = LatexExporter(template_file='article').from_filename(self._get_notebook())
68 assert len(output) > 0 No newline at end of file
68 assert len(output) > 0
General Comments 0
You need to be logged in to leave comments. Login now