# Path: git_trac/cmdline.py
# def make_parser():
#     monkey_patch()
#     parser = argparse.ArgumentParser(description=description, add_help=False)
#     # We cannot handle "git trac --help", this is outside of our control and purely within git
#     # redefine to not print '--help' in the online help
#     parser.add_argument('-h', dest='option_help', action='store_true',
#                         default=False, 
#                         help='show this help message and exit')
# 
#     parser.add_argument('--debug', dest='debug', action='store_true',
#                         default=False, 
#                         help='debug')
#     parser.add_argument('--log', dest='log', default=None,
#                         help='one of [DEBUG, INFO, ERROR, WARNING, CRITICAL]')
#     subparsers = parser.add_subparsers(dest='subcommand')
# 
#     parser_create = subparsers.add_parser('create', help='Create new ticket')
#     parser_create.add_argument('-b', '--branch', dest='branch_name', 
#                                help='Branch name', 
#                                default=None)
#     parser_create.add_argument('summary', type=str, help='Ticket summary')
# 
#     parser_checkout = subparsers.add_parser('checkout', help='Download branch')
#     parser_checkout.add_argument('-b', '--branch', dest='branch_name', 
#                                  help='Local branch name', 
#                                  default=None)
#     parser_checkout.add_argument('ticket_or_branch', type=TicketOrBranch, 
#                                  help='Ticket number or remote branch name')
# 
#     parser_search = subparsers.add_parser('search', help='Search trac')
#     parser_search.add_argument('--branch', dest='branch_name', 
#                                help='Remote git branch name (default: local branch)', 
#                                default=None)
# 
#     parser_fetch = subparsers.add_parser('fetch', help='Fetch branch from trac ticket')
#     parser_fetch.add_argument('ticket_or_branch', nargs='?', type=TicketOrBranch, 
#                              help='Ticket number or remote branch name', default=None)
# 
#     parser_pull = subparsers.add_parser('pull', help='Get updates')
#     parser_pull.add_argument('ticket_or_branch', nargs='?', type=TicketOrBranch, 
#                              help='Ticket number or remote branch name', default=None)
# 
#     parser_push = subparsers.add_parser('push', help='Upload changes')
#     parser_push.add_argument('--force', dest='force', action='store_true',
#                             default=False, help='Force push')
#     parser_push.add_argument('--branch', dest='remote',
#                             default=None, help='Remote branch name')
#     parser_push.add_argument('ticket', nargs='?', type=int, 
#                              help='Ticket number', default=None)
# 
#     parser_get = subparsers.add_parser('get', help='Print trac page')
#     parser_get.add_argument('ticket', nargs='?', type=int, 
#                                  help='Ticket number', default=None)
# 
#     parser_depends = subparsers.add_parser('depends', help='Print trac dependencies')
#     parser_depends.add_argument('ticket', nargs='?', type=int, 
#                                 help='Ticket number', default=None)
# 
#     parser_print = subparsers.add_parser('print', help='Print trac page')
#     parser_print.add_argument('ticket', nargs='?', type=int, 
#                                  help='Ticket number', default=None)
# 
#     parser_browse = subparsers.add_parser('browse', help='Open trac page in browser')
#     parser_browse.add_argument('ticket', nargs='?', type=int, 
#                                help='Ticket number', default=None)
# 
#     parser_review = subparsers.add_parser('review', help='Show code to review')
#     parser_review.add_argument('ticket', nargs='?', type=int, 
#                                help='Ticket number', default=None)
# 
#     parser_find = subparsers.add_parser('find', help='Find trac ticket from SHA1')
#     parser_find.add_argument('commit', type=str, help='Commit SHA1')
# 
#     parser_try = subparsers.add_parser('try', help='Try out trac ticket in "detached HEAD"')
#     parser_try.add_argument('ticket_or_branch', type=TicketOrBranch, 
#                             help='Ticket number or remote branch name')
# 
#     parser_log = subparsers.add_parser('log', help='Commit log for ticket')
#     parser_log.add_argument('ticket', type=int, help='Ticket number')
#     parser_log.add_argument('--oneline', dest='oneline', action='store_true',
#                             default=False, help='One line per commit')
# 
#     parser_config = subparsers.add_parser('config', help='Configure git-trac')
#     parser_config.add_argument('--user', dest='trac_user', 
#                                help='Trac username', default=None)
#     parser_config.add_argument('--pass', dest='trac_pass', 
#                                help='Trac password', default=None)
#     parser_config.add_argument('--token', dest='trac_token',
#                                help="Trac authentication token (this can "
#                                     "be used in lieu of username/password "
#                                     "and must be used if you authenticate "
#                                     "with Trac via GitHub)")
# 
#     parser_cheatsheet = subparsers.add_parser('cheat-sheet', help='Show the git trac cheat sheet')
# 
#     parser_help = subparsers.add_parser('help', help='Show the git trac help')
# 
#     return parser


import unittest
from git_trac.cmdline import make_parser
"""
Test the command line argument parser
"""



class ParserTests(unittest.TestCase):

    def testHelp(self):

# Path: git_trac/cmdline.py
# def make_parser():
#     monkey_patch()
#     parser = argparse.ArgumentParser(description=description, add_help=False)
#     # We cannot handle "git trac --help", this is outside of our control and purely within git
#     # redefine to not print '--help' in the online help
#     parser.add_argument('-h', dest='option_help', action='store_true',
#                         default=False, 
#                         help='show this help message and exit')
# 
#     parser.add_argument('--debug', dest='debug', action='store_true',
#                         default=False, 
#                         help='debug')
#     parser.add_argument('--log', dest='log', default=None,
#                         help='one of [DEBUG, INFO, ERROR, WARNING, CRITICAL]')
#     subparsers = parser.add_subparsers(dest='subcommand')
# 
#     parser_create = subparsers.add_parser('create', help='Create new ticket')
#     parser_create.add_argument('-b', '--branch', dest='branch_name', 
#                                help='Branch name', 
#                                default=None)
#     parser_create.add_argument('summary', type=str, help='Ticket summary')
# 
#     parser_checkout = subparsers.add_parser('checkout', help='Download branch')
#     parser_checkout.add_argument('-b', '--branch', dest='branch_name', 
#                                  help='Local branch name', 
#                                  default=None)
#     parser_checkout.add_argument('ticket_or_branch', type=TicketOrBranch, 
#                                  help='Ticket number or remote branch name')
# 
#     parser_search = subparsers.add_parser('search', help='Search trac')
#     parser_search.add_argument('--branch', dest='branch_name', 
#                                help='Remote git branch name (default: local branch)', 
#                                default=None)
# 
#     parser_fetch = subparsers.add_parser('fetch', help='Fetch branch from trac ticket')
#     parser_fetch.add_argument('ticket_or_branch', nargs='?', type=TicketOrBranch, 
#                              help='Ticket number or remote branch name', default=None)
# 
#     parser_pull = subparsers.add_parser('pull', help='Get updates')
#     parser_pull.add_argument('ticket_or_branch', nargs='?', type=TicketOrBranch, 
#                              help='Ticket number or remote branch name', default=None)
# 
#     parser_push = subparsers.add_parser('push', help='Upload changes')
#     parser_push.add_argument('--force', dest='force', action='store_true',
#                             default=False, help='Force push')
#     parser_push.add_argument('--branch', dest='remote',
#                             default=None, help='Remote branch name')
#     parser_push.add_argument('ticket', nargs='?', type=int, 
#                              help='Ticket number', default=None)
# 
#     parser_get = subparsers.add_parser('get', help='Print trac page')
#     parser_get.add_argument('ticket', nargs='?', type=int, 
#                                  help='Ticket number', default=None)
# 
#     parser_depends = subparsers.add_parser('depends', help='Print trac dependencies')
#     parser_depends.add_argument('ticket', nargs='?', type=int, 
#                                 help='Ticket number', default=None)
# 
#     parser_print = subparsers.add_parser('print', help='Print trac page')
#     parser_print.add_argument('ticket', nargs='?', type=int, 
#                                  help='Ticket number', default=None)
# 
#     parser_browse = subparsers.add_parser('browse', help='Open trac page in browser')
#     parser_browse.add_argument('ticket', nargs='?', type=int, 
#                                help='Ticket number', default=None)
# 
#     parser_review = subparsers.add_parser('review', help='Show code to review')
#     parser_review.add_argument('ticket', nargs='?', type=int, 
#                                help='Ticket number', default=None)
# 
#     parser_find = subparsers.add_parser('find', help='Find trac ticket from SHA1')
#     parser_find.add_argument('commit', type=str, help='Commit SHA1')
# 
#     parser_try = subparsers.add_parser('try', help='Try out trac ticket in "detached HEAD"')
#     parser_try.add_argument('ticket_or_branch', type=TicketOrBranch, 
#                             help='Ticket number or remote branch name')
# 
#     parser_log = subparsers.add_parser('log', help='Commit log for ticket')
#     parser_log.add_argument('ticket', type=int, help='Ticket number')
#     parser_log.add_argument('--oneline', dest='oneline', action='store_true',
#                             default=False, help='One line per commit')
# 
#     parser_config = subparsers.add_parser('config', help='Configure git-trac')
#     parser_config.add_argument('--user', dest='trac_user', 
#                                help='Trac username', default=None)
#     parser_config.add_argument('--pass', dest='trac_pass', 
#                                help='Trac password', default=None)
#     parser_config.add_argument('--token', dest='trac_token',
#                                help="Trac authentication token (this can "
#                                     "be used in lieu of username/password "
#                                     "and must be used if you authenticate "
#                                     "with Trac via GitHub)")
# 
#     parser_cheatsheet = subparsers.add_parser('cheat-sheet', help='Show the git trac cheat sheet')
# 
#     parser_help = subparsers.add_parser('help', help='Show the git trac help')
# 
#     return parser


# Path: git_trac/test/test_cmdline.py
import unittest
from git_trac.cmdline import make_parser

"""
Test the command line argument parser
"""



class ParserTests(unittest.TestCase):

    def testHelp(self):

        parser = make_parser()