From ed048d43651114582d241ac59c101dda7220026e 2012-05-26 03:20:00 From: Fernando Perez Date: 2012-05-26 03:20:00 Subject: [PATCH] Fix a few more test failures from magic API changes. --- diff --git a/IPython/core/magic_functions.py b/IPython/core/magic_functions.py index 2530c0b..65883be 100644 --- a/IPython/core/magic_functions.py +++ b/IPython/core/magic_functions.py @@ -3143,7 +3143,7 @@ class OSMagics(Magics): tgt = os.path.expanduser(unquote_filename(parameter_s)) cwd = os.getcwdu().replace(self.shell.home_dir,'~') if tgt: - self.magic_cd(parameter_s) + self.cd(parameter_s) dir_s.insert(0,cwd) return self.shell.magic('dirs') @@ -3154,7 +3154,7 @@ class OSMagics(Magics): if not self.shell.dir_stack: raise UsageError("%popd on empty stack") top = self.shell.dir_stack.pop(0) - self.magic_cd(top) + self.cd(top) print "popd ->",top @line_magic diff --git a/IPython/core/tests/test_magic.py b/IPython/core/tests/test_magic.py index 8e9a1bd..e8f3ea6 100644 --- a/IPython/core/tests/test_magic.py +++ b/IPython/core/tests/test_magic.py @@ -29,6 +29,8 @@ from IPython.utils.tempdir import TemporaryDirectory # Test functions begin #----------------------------------------------------------------------------- +@magic.register_magics +class DummyMagics(magic.Magics): pass def test_rehashx(): # clear up everything @@ -53,7 +55,7 @@ def test_magic_parse_options(): """Test that we don't mangle paths when parsing magic options.""" ip = get_ipython() path = 'c:\\x' - m = magic.Magics(ip) + m = DummyMagics(ip) opts = m.parse_options('-f %s' % path,'f:')[0] # argv splitting is os-dependent if os.name == 'posix': @@ -287,7 +289,7 @@ def test_parse_options(): """Tests for basic options parsing in magics.""" # These are only the most minimal of tests, more should be added later. At # the very least we check that basic text/unicode calls work OK. - m = magic.Magics(ip) + m = DummyMagics(_ip) nt.assert_equal(m.parse_options('foo', '')[1], 'foo') nt.assert_equal(m.parse_options(u'foo', '')[1], u'foo')