Show More
@@ -1,27 +1,12 b'' | |||
|
1 | 1 | """Base TestCase class for testing Exporters""" |
|
2 | 2 | |
|
3 | #----------------------------------------------------------------------------- | |
|
4 | # Copyright (c) 2013, the IPython Development Team. | |
|
5 | # | |
|
3 | # Copyright (c) IPython Development Team. | |
|
6 | 4 | # Distributed under the terms of the Modified BSD License. |
|
7 | # | |
|
8 | # The full license is in the file COPYING.txt, distributed with this software. | |
|
9 | #----------------------------------------------------------------------------- | |
|
10 | ||
|
11 | #----------------------------------------------------------------------------- | |
|
12 | # Imports | |
|
13 | #----------------------------------------------------------------------------- | |
|
14 | 5 | |
|
15 | 6 | import os |
|
16 | 7 | |
|
17 | from IPython.testing.decorators import onlyif_any_cmd_exists | |
|
18 | ||
|
19 | 8 | from ...tests.base import TestsBase |
|
20 | 9 | |
|
21 | #----------------------------------------------------------------------------- | |
|
22 | # Class | |
|
23 | #----------------------------------------------------------------------------- | |
|
24 | ||
|
25 | 10 | all_raw_mimetypes = { |
|
26 | 11 | 'text/x-python', |
|
27 | 12 | 'text/markdown', |
@@ -39,7 +24,6 b' class ExportersTestsBase(TestsBase):' | |||
|
39 | 24 | def _get_notebook(self, nb_name='notebook2.ipynb'): |
|
40 | 25 | return os.path.join(self._get_files_path(), nb_name) |
|
41 | 26 | |
|
42 | @onlyif_any_cmd_exists('nodejs', 'node', 'pandoc') | |
|
43 | 27 | def test_raw_cell_inclusion(self): |
|
44 | 28 | """test raw cell inclusion based on raw_mimetype metadata""" |
|
45 | 29 | if self.should_include_raw is None: |
@@ -1,25 +1,12 b'' | |||
|
1 | 1 | """Tests for HTMLExporter""" |
|
2 | 2 | |
|
3 | #----------------------------------------------------------------------------- | |
|
4 | # Copyright (c) 2013, the IPython Development Team. | |
|
5 | # | |
|
3 | # Copyright (c) IPython Development Team. | |
|
6 | 4 | # Distributed under the terms of the Modified BSD License. |
|
7 | # | |
|
8 | # The full license is in the file COPYING.txt, distributed with this software. | |
|
9 | #----------------------------------------------------------------------------- | |
|
10 | ||
|
11 | #----------------------------------------------------------------------------- | |
|
12 | # Imports | |
|
13 | #----------------------------------------------------------------------------- | |
|
14 | 5 | |
|
15 | 6 | from .base import ExportersTestsBase |
|
16 | 7 | from ..html import HTMLExporter |
|
17 | from IPython.testing.decorators import onlyif_any_cmd_exists | |
|
18 | 8 | import re |
|
19 | 9 | |
|
20 | #----------------------------------------------------------------------------- | |
|
21 | # Class | |
|
22 | #----------------------------------------------------------------------------- | |
|
23 | 10 | |
|
24 | 11 | class TestHTMLExporter(ExportersTestsBase): |
|
25 | 12 | """Tests for HTMLExporter""" |
@@ -34,7 +21,6 b' class TestHTMLExporter(ExportersTestsBase):' | |||
|
34 | 21 | HTMLExporter() |
|
35 | 22 | |
|
36 | 23 | |
|
37 | @onlyif_any_cmd_exists('nodejs', 'node', 'pandoc') | |
|
38 | 24 | def test_export(self): |
|
39 | 25 | """ |
|
40 | 26 | Can a HTMLExporter export something? |
@@ -43,7 +29,6 b' class TestHTMLExporter(ExportersTestsBase):' | |||
|
43 | 29 | assert len(output) > 0 |
|
44 | 30 | |
|
45 | 31 | |
|
46 | @onlyif_any_cmd_exists('nodejs', 'node', 'pandoc') | |
|
47 | 32 | def test_export_basic(self): |
|
48 | 33 | """ |
|
49 | 34 | Can a HTMLExporter export using the 'basic' template? |
@@ -52,7 +37,6 b' class TestHTMLExporter(ExportersTestsBase):' | |||
|
52 | 37 | assert len(output) > 0 |
|
53 | 38 | |
|
54 | 39 | |
|
55 | @onlyif_any_cmd_exists('nodejs', 'node', 'pandoc') | |
|
56 | 40 | def test_export_full(self): |
|
57 | 41 | """ |
|
58 | 42 | Can a HTMLExporter export using the 'full' template? |
@@ -60,7 +44,6 b' class TestHTMLExporter(ExportersTestsBase):' | |||
|
60 | 44 | (output, resources) = HTMLExporter(template_file='full').from_filename(self._get_notebook()) |
|
61 | 45 | assert len(output) > 0 |
|
62 | 46 | |
|
63 | @onlyif_any_cmd_exists('nodejs', 'node', 'pandoc') | |
|
64 | 47 | def test_prompt_number(self): |
|
65 | 48 | """ |
|
66 | 49 | Does HTMLExporter properly format input and output prompts? |
@@ -76,7 +59,6 b' class TestHTMLExporter(ExportersTestsBase):' | |||
|
76 | 59 | assert re.findall(in_regex, output) == ins |
|
77 | 60 | assert re.findall(out_regex, output) == outs |
|
78 | 61 | |
|
79 | @onlyif_any_cmd_exists('nodejs', 'node', 'pandoc') | |
|
80 | 62 | def test_png_metadata(self): |
|
81 | 63 | """ |
|
82 | 64 | Does HTMLExporter with the 'basic' template treat pngs with width/height metadata correctly? |
@@ -1,24 +1,11 b'' | |||
|
1 | 1 | """Tests for SlidesExporter""" |
|
2 | 2 | |
|
3 | #----------------------------------------------------------------------------- | |
|
4 | # Copyright (c) 2013, the IPython Development Team. | |
|
5 | # | |
|
3 | # Copyright (c) IPython Development Team. | |
|
6 | 4 | # Distributed under the terms of the Modified BSD License. |
|
7 | # | |
|
8 | # The full license is in the file COPYING.txt, distributed with this software. | |
|
9 | #----------------------------------------------------------------------------- | |
|
10 | ||
|
11 | #----------------------------------------------------------------------------- | |
|
12 | # Imports | |
|
13 | #----------------------------------------------------------------------------- | |
|
14 | 5 | |
|
15 | 6 | from .base import ExportersTestsBase |
|
16 | 7 | from ..slides import SlidesExporter |
|
17 | from IPython.testing.decorators import onlyif_any_cmd_exists | |
|
18 | 8 | |
|
19 | #----------------------------------------------------------------------------- | |
|
20 | # Class | |
|
21 | #----------------------------------------------------------------------------- | |
|
22 | 9 | |
|
23 | 10 | class TestSlidesExporter(ExportersTestsBase): |
|
24 | 11 | """Tests for SlidesExporter""" |
@@ -33,7 +20,6 b' class TestSlidesExporter(ExportersTestsBase):' | |||
|
33 | 20 | SlidesExporter() |
|
34 | 21 | |
|
35 | 22 | |
|
36 | @onlyif_any_cmd_exists('nodejs', 'node', 'pandoc') | |
|
37 | 23 | def test_export(self): |
|
38 | 24 | """ |
|
39 | 25 | Can a SlidesExporter export something? |
@@ -42,7 +28,6 b' class TestSlidesExporter(ExportersTestsBase):' | |||
|
42 | 28 | assert len(output) > 0 |
|
43 | 29 | |
|
44 | 30 | |
|
45 | @onlyif_any_cmd_exists('nodejs', 'node', 'pandoc') | |
|
46 | 31 | def test_export_reveal(self): |
|
47 | 32 | """ |
|
48 | 33 | Can a SlidesExporter export using the 'reveal' template? |
General Comments 0
You need to be logged in to leave comments.
Login now