##// END OF EJS Templates
Fix tests for saving non-ascii history.
Thomas Kluyver -
Show More
@@ -32,7 +32,7 b' def test_history():'
32 hist_file = os.path.join(tmpdir, 'history.sqlite')
32 hist_file = os.path.join(tmpdir, 'history.sqlite')
33 try:
33 try:
34 ip.history_manager = HistoryManager(shell=ip, hist_file=hist_file)
34 ip.history_manager = HistoryManager(shell=ip, hist_file=hist_file)
35 hist = ['a=1', 'def f():\n test = 1\n return test', u"b='€Æ¾÷ß'"]
35 hist = [u'a=1', u'def f():\n test = 1\n return test', u"b='€Æ¾÷ß'"]
36 for i, h in enumerate(hist, start=1):
36 for i, h in enumerate(hist, start=1):
37 ip.history_manager.store_inputs(i, h)
37 ip.history_manager.store_inputs(i, h)
38
38
@@ -54,12 +54,10 b' def test_history():'
54 ip.magic('%hist 2-500')
54 ip.magic('%hist 2-500')
55
55
56 # Check that we can write non-ascii characters to a file
56 # Check that we can write non-ascii characters to a file
57 tmpdir = tempfile.mkdtemp()
57 ip.magic("%%hist -f %s" % os.path.join(tmpdir, "test1"))
58 try:
58 ip.magic("%%hist -pf %s" % os.path.join(tmpdir, "test2"))
59 ip.magic("%%hist -f %s" % os.path.join(tmpdir, "test1"))
59 ip.magic("%%hist -nf %s" % os.path.join(tmpdir, "test3"))
60 ip.magic("%%save %s 1-10" % os.path.join(tmpdir, "test2"))
60 ip.magic("%%save %s 1-10" % os.path.join(tmpdir, "test4"))
61 finally:
62 shutil.rmtree(tmpdir)
63
61
64 # New session
62 # New session
65 ip.history_manager.reset()
63 ip.history_manager.reset()
General Comments 0
You need to be logged in to leave comments. Login now