Show More
@@ -5,6 +5,7 b'' | |||||
5 |
|
5 | |||
6 | import os.path |
|
6 | import os.path | |
7 | import textwrap |
|
7 | import textwrap | |
|
8 | import re | |||
8 |
|
9 | |||
9 | from .base import ExportersTestsBase |
|
10 | from .base import ExportersTestsBase | |
10 | from ..latex import LatexExporter |
|
11 | from ..latex import LatexExporter | |
@@ -99,3 +100,18 b' class TestLatexExporter(ExportersTestsBase):' | |||||
99 |
|
100 | |||
100 | (output, resources) = LatexExporter(template_file='article').from_filename(nbfile) |
|
101 | (output, resources) = LatexExporter(template_file='article').from_filename(nbfile) | |
101 | assert len(output) > 0 |
|
102 | assert len(output) > 0 | |
|
103 | ||||
|
104 | @onlyif_cmds_exist('pandoc') | |||
|
105 | def test_prompt_number_color(self): | |||
|
106 | """ | |||
|
107 | Does LatexExporter properly format input and output prompts in color? | |||
|
108 | """ | |||
|
109 | (output, resources) = LatexExporter().from_filename(self._get_notebook()) | |||
|
110 | in_regex = r"In \[\{\\color\{incolor\}(.*)\}\]:" | |||
|
111 | out_regex = r"Out\[\{\\color\{outcolor\}(.*)\}\]:" | |||
|
112 | ||||
|
113 | ins = ["1", "2", "6", "7", "8", "10", "14", " ", " "] | |||
|
114 | outs = ["7", "10", "14"] | |||
|
115 | ||||
|
116 | assert re.findall(in_regex, output) == ins | |||
|
117 | assert re.findall(out_regex, output) == outs |
General Comments 0
You need to be logged in to leave comments.
Login now