##// END OF EJS Templates
Reverse hscrollbar min-height hack on OS X...
Reverse hscrollbar min-height hack on OS X OS X has optional behavior to only draw scrollbars during scroll, which causes problems for CodeMirror's scrollbars. CodeMirror's solution is to set a minimum size for their scrollbars, which is always present. The trade is that the container overlays most of the last line, swallowing click events when there is scrolling to do, even when no scrollbar is visible. This reverses the trade, recovering the click events at the expense of never showing the horizontal scrollbar on OS X when this option is enabled.

File last commit:

r19812:2c766c85
r20298:2907e856
Show More
test_script.py
44 lines | 1.3 KiB | text/x-python | PythonLexer
"""Tests for ScriptExporter"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
from IPython.nbformat import v4
from IPython.utils.py3compat import PY3
from .base import ExportersTestsBase
from ..script import ScriptExporter
class TestScriptExporter(ExportersTestsBase):
"""Tests for ScriptExporter"""
exporter_class = ScriptExporter
def test_constructor(self):
"""Construct ScriptExporter"""
e = self.exporter_class()
def test_export(self):
"""ScriptExporter can export something"""
(output, resources) = self.exporter_class().from_filename(self._get_notebook())
assert len(output) > 0
def test_export_python(self):
"""delegate to custom exporter from language_info"""
exporter = self.exporter_class()
pynb = v4.new_notebook()
(output, resources) = self.exporter_class().from_notebook_node(pynb)
self.assertNotIn('# coding: utf-8', output)
pynb.metadata.language_info = {
'name': 'python',
'mimetype': 'text/x-python',
'nbconvert_exporter': 'python',
}
(output, resources) = self.exporter_class().from_notebook_node(pynb)
self.assertIn('# coding: utf-8', output)