Show More
@@ -1,7 +1,10 b'' | |||||
|
1 | # -*- coding: utf-8 | |||
1 | """Tests for prompt generation.""" |
|
2 | """Tests for prompt generation.""" | |
2 |
|
3 | |||
|
4 | import tempfile | |||
3 | import unittest |
|
5 | import unittest | |
4 |
|
6 | |||
|
7 | import os | |||
5 | import nose.tools as nt |
|
8 | import nose.tools as nt | |
6 |
|
9 | |||
7 | from IPython.testing import tools as tt, decorators as dec |
|
10 | from IPython.testing import tools as tt, decorators as dec | |
@@ -60,3 +63,15 b' class PromptTests(unittest.TestCase):' | |||||
60 | def test_render(self): |
|
63 | def test_render(self): | |
61 | self.pm.in_template = r'\#>' |
|
64 | self.pm.in_template = r'\#>' | |
62 | self.assertEqual(self.pm.render('in',color=False), '%d>' % ip.execution_count) |
|
65 | self.assertEqual(self.pm.render('in',color=False), '%d>' % ip.execution_count) | |
|
66 | ||||
|
67 | def test_render_unicode(self): | |||
|
68 | td = tempfile.mkdtemp(u'ünicødé') | |||
|
69 | save = os.getcwdu() | |||
|
70 | os.chdir(td) | |||
|
71 | self.pm.in_template = r'\w [\#]' | |||
|
72 | try: | |||
|
73 | p = self.pm.render('in', color=False) | |||
|
74 | self.assertEquals(p, u"%s [%i]" % (os.getcwdu(), ip.execution_count)) | |||
|
75 | finally: | |||
|
76 | os.chdir(save) | |||
|
77 | os.rmdir(td) |
General Comments 0
You need to be logged in to leave comments.
Login now