##// END OF EJS Templates
Inlining is not an attribute of resources
Inlining is not an attribute of resources

File last commit:

r12023:97a9537b
r12024:1fae527f
Show More
base.py
43 lines | 1.8 KiB | text/x-python | PythonLexer
"""
Module with utility functions for transformer tests
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from ...tests.base import TestsBase
from IPython.nbformat import current as nbformat
#-----------------------------------------------------------------------------
# Class
#-----------------------------------------------------------------------------
class TransformerTestsBase(TestsBase):
"""Contains test functions transformer tests"""
def build_notebook(self):
"""Build a notebook in memory for use with transformer tests"""
outputs = [nbformat.new_output(output_type="stream", stream="stdout", output_text="a"),
nbformat.new_output(output_type="text", output_text="b"),
nbformat.new_output(output_type="stream", stream="stdout", output_text="c"),
nbformat.new_output(output_type="stream", stream="stdout", output_text="d"),
nbformat.new_output(output_type="stream", stream="stderr", output_text="e"),
nbformat.new_output(output_type="stream", stream="stderr", output_text="f")]
cells=[nbformat.new_code_cell(input="test",
prompt_number=1,outputs=outputs)]
worksheets = [nbformat.new_worksheet(name="worksheet1", cells=cells)]
return nbformat.new_notebook(name="notebook1", worksheets=worksheets)