def test__parse_help(): cmd, options, cmdoptions, args = dispatch._parse(['help']) assert cmd == 'help' cmd, options, cmdoptions, args = dispatch._parse([]) assert cmd == 'help' cmd, options, cmdoptions, args = dispatch._parse(['-h']) assert cmd == 'help' assert options['help'] == True
def test__parse_subcmd_options(): cmd, options, cmdoptions, args = dispatch._parse(['push', '-b', 'http://localhost']) assert cmd == 'push' assert cmdoptions['browse'] == True
def long(): dispatch._parse(['--unkown'])
def app_arg(): dispatch._parse(['init', '-X'])
def short(): dispatch._parse(['-X'])
def test__parse_subcmd_options(): cmd, options, cmdoptions, args = dispatch._parse( ['push', '-b', 'http://localhost']) assert cmd == 'push' assert cmdoptions['browse'] == True