Show More
@@ -53,7 +53,7 b' class TestExporter(ExportersTestsBase):' | |||
|
53 | 53 | exporter = self._make_exporter(config=config) |
|
54 | 54 | (output, resources) = exporter.from_filename(self._get_notebook()) |
|
55 | 55 | assert resources is not None |
|
56 |
assert 'outputs' |
|
|
56 | assert isinstance(resources['outputs'], dict) | |
|
57 | 57 | assert len(resources['outputs']) > 0 |
|
58 | 58 | |
|
59 | 59 | |
@@ -65,7 +65,6 b' class TestExporter(ExportersTestsBase):' | |||
|
65 | 65 | exporter = self._make_exporter(config=config) |
|
66 | 66 | (output, resources) = exporter.from_filename(self._get_notebook()) |
|
67 | 67 | assert resources is not None |
|
68 | assert 'cheese' in resources | |
|
69 | 68 | assert resources['cheese'] == 'real' |
|
70 | 69 | |
|
71 | 70 | |
@@ -77,7 +76,6 b' class TestExporter(ExportersTestsBase):' | |||
|
77 | 76 | exporter = self._make_exporter(config=config) |
|
78 | 77 | (output, resources) = exporter.from_filename(self._get_notebook()) |
|
79 | 78 | assert resources is not None |
|
80 | assert 'cheese' in resources | |
|
81 | 79 | assert resources['cheese'] == 'real' |
|
82 | 80 | |
|
83 | 81 | |
@@ -89,7 +87,6 b' class TestExporter(ExportersTestsBase):' | |||
|
89 | 87 | exporter = self._make_exporter(config=config) |
|
90 | 88 | (output, resources) = exporter.from_filename(self._get_notebook()) |
|
91 | 89 | assert resources is not None |
|
92 | assert 'cheese' in resources | |
|
93 | 90 | assert resources['cheese'] == 'real' |
|
94 | 91 | |
|
95 | 92 | |
@@ -101,7 +98,6 b' class TestExporter(ExportersTestsBase):' | |||
|
101 | 98 | exporter.register_transformer(CheeseTransformer, enabled=True) |
|
102 | 99 | (output, resources) = exporter.from_filename(self._get_notebook()) |
|
103 | 100 | assert resources is not None |
|
104 | assert 'cheese' in resources | |
|
105 | 101 | assert resources['cheese'] == 'real' |
|
106 | 102 | |
|
107 | 103 |
@@ -57,7 +57,7 b' class ExtractOutputTransformer(Transformer):' | |||
|
57 | 57 | output_files_dir = resources.get('output_files_dir', None) |
|
58 | 58 | |
|
59 | 59 | #Make sure outputs key exists |
|
60 |
if not 'outputs' |
|
|
60 | if not isinstance(resources['outputs'], dict): | |
|
61 | 61 | resources['outputs'] = {} |
|
62 | 62 | |
|
63 | 63 | #Loop through all of the outputs in the cell |
@@ -54,7 +54,7 b' class RevealHelpTransformer(Transformer):' | |||
|
54 | 54 | worksheet.cells[index - 1].metadata.slide_helper = 'subslide_end' |
|
55 | 55 | |
|
56 | 56 | |
|
57 |
if 'reveal' |
|
|
57 | if not isinstance(resources['reveal'], dict): | |
|
58 | 58 | resources['reveal'] = {} |
|
59 | 59 | resources['reveal']['url_prefix'] = self.url_prefix |
|
60 | 60 |
@@ -127,7 +127,7 b' class SphinxTransformer(Transformer):' | |||
|
127 | 127 | # TODO: Add versatile method of additional notebook metadata. Include |
|
128 | 128 | # handling of multiple files. For now use a temporay namespace, |
|
129 | 129 | # '_draft' to signify that this needs to change. |
|
130 |
if not "sphinx" |
|
|
130 | if not isinstance(resources["sphinx"], dict): | |
|
131 | 131 | resources["sphinx"] = {} |
|
132 | 132 | |
|
133 | 133 | if self.interactive: |
@@ -44,5 +44,4 b' class TestCSSHTMLHeader(TransformerTestsBase):' | |||
|
44 | 44 | res = self.build_resources() |
|
45 | 45 | transformer = self.build_transformer() |
|
46 | 46 | nb, res = transformer(nb, res) |
|
47 | assert 'inlining' in res | |
|
48 | 47 | assert 'css' in res['inlining'] No newline at end of file |
@@ -53,9 +53,6 b' class TestExtractOutput(TransformerTestsBase):' | |||
|
53 | 53 | assert 'png_filename' in nb.worksheets[0].cells[0].outputs[6] |
|
54 | 54 | png_filename = nb.worksheets[0].cells[0].outputs[6]['png_filename'] |
|
55 | 55 | |
|
56 | # Make sure an entry to the resources was added. | |
|
57 | assert 'outputs' in res | |
|
58 | ||
|
59 | 56 | # Verify text output |
|
60 | 57 | assert text_filename in res['outputs'] |
|
61 | 58 | self.assertEqual(res['outputs'][text_filename], b'b') |
@@ -45,7 +45,6 b' class TestSphinx(TransformerTestsBase):' | |||
|
45 | 45 | res = self.build_resources() |
|
46 | 46 | transformer = self.build_transformer() |
|
47 | 47 | nb, res = transformer(nb, res) |
|
48 | assert 'sphinx' in res | |
|
49 | 48 | assert "author" in res['sphinx'] |
|
50 | 49 | assert "version" in res['sphinx'] |
|
51 | 50 | assert "release" in res['sphinx'] |
@@ -33,7 +33,7 b' class DebugWriter(WriterBase):' | |||
|
33 | 33 | See base for more... |
|
34 | 34 | """ |
|
35 | 35 | |
|
36 | if 'outputs' in resources: | |
|
36 | if isinstance(resources['outputs'], dict): | |
|
37 | 37 | print("outputs extracted from %s" % notebook_name) |
|
38 | 38 | print('-' * 80) |
|
39 | 39 | pprint(resources['outputs'], indent=2, width=70) |
General Comments 0
You need to be logged in to leave comments.
Login now