##// END OF EJS Templates
Fix more escape sequences
Fix more escape sequences

File last commit:

r23044:7e78dda8
r24452:a6179e39
Show More
test_prompts.py
34 lines | 918 B | 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
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)
Srinivas Reddy Thatiparthy
remove unicode_type function
r23044 self.assertEqual(str(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))
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