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