# Path: gh/base.py
# class Command(object):
# class CustomOptionParser(OptionParser):
#     SUCCESS = 0
#     FAILURE = 1
#     COMMAND_UNKNOWN = 127
#     def __init__(self):
#     def run(self, options, args):
#     def get_repo(self, options):
#     def get_user(self):
#     def login(self):
#     def help(self):
#     def __init__(self, *args, **kwargs):
# def load_command(name):


from unittest import TestCase
from gh.base import (Command, CustomOptionParser, load_command, commands,
                     main_parser)
import sys


class TestCommand(TestCase):
    def test_run(self):
        class A(Command):
            pass

        try:
            a = A()
            a.run([], [])
        except (TypeError, AssertionError):
            pass


class TestCustomOptionParser(TestCase):
    def test_help(self):
        c = CustomOptionParser()
        assert c.has_option('-h') is True
        assert c.defaults == {'help': False}


class TestBase(TestCase):
    command = 'issue'
    mod = 'gh.commands.issue'

    def setUp(self):
        self.mods = sys.modules.copy()
        if self.mod in sys.modules:
            del sys.modules[self.mod]


# Path: gh/base.py
# class Command(object):
# class CustomOptionParser(OptionParser):
#     SUCCESS = 0
#     FAILURE = 1
#     COMMAND_UNKNOWN = 127
#     def __init__(self):
#     def run(self, options, args):
#     def get_repo(self, options):
#     def get_user(self):
#     def login(self):
#     def help(self):
#     def __init__(self, *args, **kwargs):
# def load_command(name):


# Path: tests/test_base.py
from unittest import TestCase
from gh.base import (Command, CustomOptionParser, load_command, commands,
                     main_parser)
import sys



class TestCommand(TestCase):
    def test_run(self):
        class A(Command):
            pass

        try:
            a = A()
            a.run([], [])
        except (TypeError, AssertionError):
            pass


class TestCustomOptionParser(TestCase):
    def test_help(self):
        c = CustomOptionParser()
        assert c.has_option('-h') is True
        assert c.defaults == {'help': False}


class TestBase(TestCase):
    command = 'issue'
    mod = 'gh.commands.issue'

    def setUp(self):
        self.mods = sys.modules.copy()
        if self.mod in sys.modules:
            del sys.modules[self.mod]


        global commands