# Path: dragonpy/dev_shell.py
# class DevShellApp(DevShellBaseApp):
#     # Remove some commands:
#     delattr(cmd2.Cmd, 'do_edit')
#     delattr(cmd2.Cmd, 'do_shell')
#     delattr(cmd2.Cmd, 'do_run_script')
#     delattr(cmd2.Cmd, 'do_run_pyscript')
# 
#     def __init__(self, *args, **kwargs):
#         super().__init__(*args, **kwargs)
#         self.intro = f'Developer shell - {bright_yellow("DragonPy")} - v{dragonpy.__version__}\n'
#         self.intro += """
#             ********************************************************
#             * DragonPy is a Open source (GPL v3 or later) emulator *
#             * for the 30 years old homecomputer Dragon 32          *
#             * and Tandy TRS-80 Color Computer (CoCo)...            *
#             ********************************************************
#             * Homepage: https://github.com/jedie/DragonPy          *
#             ********************************************************
#         """
# 
# def get_devshell_app_kwargs():
#     """
#     Generate the kwargs for the cmd2 App.
#     (Separated because we needs the same kwargs in tests)
#     """
#     config = DevShellConfig(package_module=dragonpy)
# 
#     # initialize all CommandSet() with context:
#     kwargs = dict(config=config)
# 
#     app_kwargs = dict(
#         config=config,
#         command_sets=[
#             DragonPyCommandSet(**kwargs),
#             DevShellCommandSet(**kwargs),
#         ],
#     )
#     return app_kwargs


from cmd2 import CommandResult
from cmd2_ext_test import ExternalTestMixin
from dev_shell.tests.fixtures import CmdAppBaseTestCase
from dragonpy.dev_shell import DevShellApp, get_devshell_app_kwargs



class DevShellAppTester(ExternalTestMixin, DevShellApp):
    pass


class DevShellAppBaseTestCase(CmdAppBaseTestCase):
    """
    Base class for dev-shell tests
    """

    def get_app_instance(self):
        # Init the test app with the same kwargs as the real app
        # see: dev_shell.cmd2app.devshell_cmdloop()

# Path: dragonpy/dev_shell.py
# class DevShellApp(DevShellBaseApp):
#     # Remove some commands:
#     delattr(cmd2.Cmd, 'do_edit')
#     delattr(cmd2.Cmd, 'do_shell')
#     delattr(cmd2.Cmd, 'do_run_script')
#     delattr(cmd2.Cmd, 'do_run_pyscript')
# 
#     def __init__(self, *args, **kwargs):
#         super().__init__(*args, **kwargs)
#         self.intro = f'Developer shell - {bright_yellow("DragonPy")} - v{dragonpy.__version__}\n'
#         self.intro += """
#             ********************************************************
#             * DragonPy is a Open source (GPL v3 or later) emulator *
#             * for the 30 years old homecomputer Dragon 32          *
#             * and Tandy TRS-80 Color Computer (CoCo)...            *
#             ********************************************************
#             * Homepage: https://github.com/jedie/DragonPy          *
#             ********************************************************
#         """
# 
# def get_devshell_app_kwargs():
#     """
#     Generate the kwargs for the cmd2 App.
#     (Separated because we needs the same kwargs in tests)
#     """
#     config = DevShellConfig(package_module=dragonpy)
# 
#     # initialize all CommandSet() with context:
#     kwargs = dict(config=config)
# 
#     app_kwargs = dict(
#         config=config,
#         command_sets=[
#             DragonPyCommandSet(**kwargs),
#             DevShellCommandSet(**kwargs),
#         ],
#     )
#     return app_kwargs


# Path: dragonpy/tests/test_devshell_commands.py
from cmd2 import CommandResult
from cmd2_ext_test import ExternalTestMixin
from dev_shell.tests.fixtures import CmdAppBaseTestCase
from dragonpy.dev_shell import DevShellApp, get_devshell_app_kwargs




class DevShellAppTester(ExternalTestMixin, DevShellApp):
    pass


class DevShellAppBaseTestCase(CmdAppBaseTestCase):
    """
    Base class for dev-shell tests
    """

    def get_app_instance(self):
        # Init the test app with the same kwargs as the real app
        # see: dev_shell.cmd2app.devshell_cmdloop()

        app = DevShellAppTester(**get_devshell_app_kwargs())