##// END OF EJS Templates
Merging Fernando's trunk (fp-trunk-dev) and Brian's edits (fp-review)....
Merging Fernando's trunk (fp-trunk-dev) and Brian's edits (fp-review). This is a huge merge of months worth of work by Fernando and Brian. Some highlights: * The test suite has been ported to use the new APIs. * The test suite runs and passes on all platforms!!! * The IPython Sphinx directive has been updated to use the new APIs. * %history works again. * New %tb magic for showing last traceback. * Significant design improvements in the config loaders and applications. * Zillions of bugs fixed. * Completely new %pylab implementation that uses the new GUI support. This allows pylab to be enabled *at runtime*. * Many other things.

File last commit:

r2426:61e33e8e
r2515:08ca9176 merge
Show More
test_prefilter.py
34 lines | 1.1 KiB | text/x-python | PythonLexer
"""Tests for input manipulation machinery."""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import nose.tools as nt
from IPython.testing import tools as tt, decorators as dec
#-----------------------------------------------------------------------------
# Tests
#-----------------------------------------------------------------------------
@dec.parametric
def test_prefilter():
"""Test user input conversions"""
# pairs of (raw, expected correct) input
pairs = [ ('2+2','2+2'),
('>>> 2+2','2+2'),
('>>> # This is a comment\n'
'... 2+2',
'# This is a comment\n'
'2+2'),
# Some IPython input
('In [1]: 1', '1'),
('In [2]: for i in range(5):\n'
' ...: print i,',
'for i in range(5):\n'
' print i,'),
]
ip = get_ipython()
for raw, correct in pairs:
yield nt.assert_equals(ip.prefilter(raw), correct)