##// END OF EJS Templates
Fix a few more test failures from magic API changes.
Fernando Perez -
Show More
@@ -3143,7 +3143,7 b' class OSMagics(Magics):'
3143 tgt = os.path.expanduser(unquote_filename(parameter_s))
3143 tgt = os.path.expanduser(unquote_filename(parameter_s))
3144 cwd = os.getcwdu().replace(self.shell.home_dir,'~')
3144 cwd = os.getcwdu().replace(self.shell.home_dir,'~')
3145 if tgt:
3145 if tgt:
3146 self.magic_cd(parameter_s)
3146 self.cd(parameter_s)
3147 dir_s.insert(0,cwd)
3147 dir_s.insert(0,cwd)
3148 return self.shell.magic('dirs')
3148 return self.shell.magic('dirs')
3149
3149
@@ -3154,7 +3154,7 b' class OSMagics(Magics):'
3154 if not self.shell.dir_stack:
3154 if not self.shell.dir_stack:
3155 raise UsageError("%popd on empty stack")
3155 raise UsageError("%popd on empty stack")
3156 top = self.shell.dir_stack.pop(0)
3156 top = self.shell.dir_stack.pop(0)
3157 self.magic_cd(top)
3157 self.cd(top)
3158 print "popd ->",top
3158 print "popd ->",top
3159
3159
3160 @line_magic
3160 @line_magic
@@ -29,6 +29,8 b' from IPython.utils.tempdir import TemporaryDirectory'
29 # Test functions begin
29 # Test functions begin
30 #-----------------------------------------------------------------------------
30 #-----------------------------------------------------------------------------
31
31
32 @magic.register_magics
33 class DummyMagics(magic.Magics): pass
32
34
33 def test_rehashx():
35 def test_rehashx():
34 # clear up everything
36 # clear up everything
@@ -53,7 +55,7 b' def test_magic_parse_options():'
53 """Test that we don't mangle paths when parsing magic options."""
55 """Test that we don't mangle paths when parsing magic options."""
54 ip = get_ipython()
56 ip = get_ipython()
55 path = 'c:\\x'
57 path = 'c:\\x'
56 m = magic.Magics(ip)
58 m = DummyMagics(ip)
57 opts = m.parse_options('-f %s' % path,'f:')[0]
59 opts = m.parse_options('-f %s' % path,'f:')[0]
58 # argv splitting is os-dependent
60 # argv splitting is os-dependent
59 if os.name == 'posix':
61 if os.name == 'posix':
@@ -287,7 +289,7 b' def test_parse_options():'
287 """Tests for basic options parsing in magics."""
289 """Tests for basic options parsing in magics."""
288 # These are only the most minimal of tests, more should be added later. At
290 # These are only the most minimal of tests, more should be added later. At
289 # the very least we check that basic text/unicode calls work OK.
291 # the very least we check that basic text/unicode calls work OK.
290 m = magic.Magics(ip)
292 m = DummyMagics(_ip)
291 nt.assert_equal(m.parse_options('foo', '')[1], 'foo')
293 nt.assert_equal(m.parse_options('foo', '')[1], 'foo')
292 nt.assert_equal(m.parse_options(u'foo', '')[1], u'foo')
294 nt.assert_equal(m.parse_options(u'foo', '')[1], u'foo')
293
295
General Comments 0
You need to be logged in to leave comments. Login now