##// END OF EJS Templates
fix some deprecations...
fix some deprecations various deprecations, especially our own usage of deprecated APIs in this package - remove few remaining references to, uses of io.stdout - suppress deprecation warnings when initializing deprecated `utils.io.std*` - globalipapp.StreamProxy is now totally unused - one missing traitlets 4.2 API in core.formatters - get gui keys from pt_inputhooks instead of deprecated lib.inputhook - stop passing deprecated color_scheme to Pdb - nt.assert_equals in test_latextools

File last commit:

r22425:566cfa83
r22742:a9028681
Show More
test_prompts.py
37 lines | 1.0 KiB | text/x-python | PythonLexer
MinRK
add failing test for unicode cwd in prompts
r7570 # -*- coding: utf-8
Thomas Kluyver
Add tests for prompt system.
r5658 """Tests for prompt generation."""
import unittest
Thomas Kluyver
Remove PromptManager class...
r22425 from IPython.core.prompts import LazyEvaluate
Thomas Kluyver
Add tests for prompt system.
r5658 from IPython.testing.globalipapp import get_ipython
Thomas Kluyver
Replace references to unicode and basestring
r13353 from IPython.utils.py3compat import unicode_type
Thomas Kluyver
Add tests for prompt system.
r5658
ip = get_ipython()
class PromptTests(unittest.TestCase):
MinRK
test LazyEvaluate with non-ascii input
r7577 def test_lazy_eval_unicode(self):
u = u'ünicødé'
lz = LazyEvaluate(lambda : u)
MinRK
use cleaner, less safe, unicode/str in LazyEvaluate
r7581 # str(lz) would fail
Thomas Kluyver
Replace references to unicode and basestring
r13353 self.assertEqual(unicode_type(lz), u)
Bradley M. Froehle
s/assertEquals/assertEqual/
r7874 self.assertEqual(format(lz), u)
MinRK
test LazyEvaluate with non-ascii input
r7577
def test_lazy_eval_nonascii_bytes(self):
u = u'ünicødé'
b = u.encode('utf8')
lz = LazyEvaluate(lambda : b)
MinRK
use cleaner, less safe, unicode/str in LazyEvaluate
r7581 # unicode(lz) would fail
Bradley M. Froehle
s/assertEquals/assertEqual/
r7874 self.assertEqual(str(lz), str(b))
self.assertEqual(format(lz), str(b))
MinRK
test LazyEval with float and format string
r7579
def test_lazy_eval_float(self):
f = 0.503
lz = LazyEvaluate(lambda : f)
Bradley M. Froehle
s/assertEquals/assertEqual/
r7874 self.assertEqual(str(lz), str(f))
Thomas Kluyver
Replace references to unicode and basestring
r13353 self.assertEqual(unicode_type(lz), unicode_type(f))
Bradley M. Froehle
s/assertEquals/assertEqual/
r7874 self.assertEqual(format(lz), str(f))
self.assertEqual(format(lz, '.1'), '0.5')
Aaron Meurer
Be a little smarter about invisible characters in terminal prompts...
r21605