MCPcopy Create free account
hub / github.com/ipython/ipython / test_magic_parse_options

Function test_magic_parse_options

IPython/core/tests/test_magic.py:155–166  ·  view source on GitHub ↗

Test that we don't mangle paths when parsing magic options.

()

Source from the content-addressed store, hash-verified

153
154
155def test_magic_parse_options():
156 """Test that we don't mangle paths when parsing magic options."""
157 ip = get_ipython()
158 path = 'c:\\x'
159 m = DummyMagics(ip)
160 opts = m.parse_options('-f %s' % path,'f:')[0]
161 # argv splitting is os-dependent
162 if os.name == 'posix':
163 expected = 'c:x'
164 else:
165 expected = path
166 nt.assert_equal(opts['f'], expected)
167
168def test_magic_parse_long_options():
169 """Magic.parse_options can handle --foo=bar long options"""

Callers

nothing calls this directly

Calls 3

get_ipythonFunction · 0.90
DummyMagicsClass · 0.85
parse_optionsMethod · 0.80

Tested by

no test coverage detected