##// END OF EJS Templates
test Magic.parse_options with long options
MinRK -
Show More
@@ -541,7 +541,7 b' class Magics(object):'
541 argv = arg_split(arg_str, posix, strict)
541 argv = arg_split(arg_str, posix, strict)
542 # Do regular option processing
542 # Do regular option processing
543 try:
543 try:
544 opts,args = getopt(argv,opt_str,*long_opts)
544 opts,args = getopt(argv, opt_str, long_opts)
545 except GetoptError,e:
545 except GetoptError,e:
546 raise UsageError('%s ( allowed: "%s" %s)' % (e.msg,opt_str,
546 raise UsageError('%s ( allowed: "%s" %s)' % (e.msg,opt_str,
547 " ".join(long_opts)))
547 " ".join(long_opts)))
@@ -69,6 +69,15 b' def test_magic_parse_options():'
69 expected = path
69 expected = path
70 nt.assert_equals(opts['f'], expected)
70 nt.assert_equals(opts['f'], expected)
71
71
72 def test_magic_parse_long_options():
73 """Magic.parse_options can handle --foo=bar long options"""
74 ip = get_ipython()
75 m = DummyMagics(ip)
76 opts, _ = m.parse_options('--foo --bar=bubble', 'a', 'foo', 'bar=')
77 nt.assert_true('foo' in opts)
78 nt.assert_true('bar' in opts)
79 nt.assert_true(opts['bar'], "bubble")
80
72
81
73 @dec.skip_without('sqlite3')
82 @dec.skip_without('sqlite3')
74 def doctest_hist_f():
83 def doctest_hist_f():
General Comments 0
You need to be logged in to leave comments. Login now