Uploaded Test files
This commit is contained in:
parent
f584ad9d97
commit
2e81cb7d99
16627 changed files with 2065359 additions and 102444 deletions
52
venv/Lib/site-packages/nbconvert/writers/tests/test_debug.py
Normal file
52
venv/Lib/site-packages/nbconvert/writers/tests/test_debug.py
Normal file
|
@ -0,0 +1,52 @@
|
|||
"""
|
||||
Module with tests for debug
|
||||
"""
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# 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
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
import sys
|
||||
|
||||
from ...tests.base import TestsBase
|
||||
from ..debug import DebugWriter
|
||||
|
||||
from io import StringIO
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Class
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
class TestDebug(TestsBase):
|
||||
"""Contains test functions for debug.py"""
|
||||
|
||||
def test_output(self):
|
||||
"""Test debug writer output."""
|
||||
|
||||
# Capture the stdout. Remember original.
|
||||
stdout = sys.stdout
|
||||
stream = StringIO()
|
||||
sys.stdout = stream
|
||||
|
||||
# Create stdout writer, get output
|
||||
writer = DebugWriter()
|
||||
writer.write('aaa', {'outputs': {'bbb': 'ccc'}})
|
||||
output = stream.getvalue()
|
||||
|
||||
# Check output. Make sure resources dictionary is dumped, but nothing
|
||||
# else.
|
||||
assert 'aaa' not in output
|
||||
assert 'bbb' in output
|
||||
assert 'ccc' in output
|
||||
|
||||
# Revert stdout
|
||||
sys.stdout = stdout
|
Loading…
Add table
Add a link
Reference in a new issue