Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# -*- coding: utf-8 -*-
import os
import pytest
from cleo import Application
from cleo import CommandTester
from .fixtures.hello_command import HelloCommand
from .fixtures.command_with_colons import CommandWithColons
app = Application()
app.add(HelloCommand())
app.add(CommandWithColons())
def test_invalid_shell():
command = app.find("completions")
tester = CommandTester(command)
with pytest.raises(ValueError):
tester.execute("pomodoro")
def test_bash(mocker):
mocker.patch(
"clikit.api.args.args.Args.script_name",
new_callable=mocker.PropertyMock,
def run_command(self, command, options=None, input_stream=None):
"""
Run the command.
:type command: cleo.commands.command.Command
:type options: list or None
"""
if options is None:
options = []
options = [('command', command.get_name())] + options
application = Application()
application.add(command)
if input_stream:
dialog = command.get_helper('question')
dialog.__class__.input_stream = input_stream
command_tester = CommandTester(command)
command_tester.execute(options)
return command_tester
def build_application():
config = Config("clevercsv", __version__)
app = Application(config=config, complete=False)
app.add(ViewCommand())
app.add(DetectCommand())
app.add(StandardizeCommand())
app.add(CodeCommand())
app.add(ExploreCommand())
return app
# -*- coding: utf-8 -*-
from cleo import Application
from ..version import VERSION
application = Application('Orator', VERSION, complete=True)
# Migrations
from .migrations import (
InstallCommand, MigrateCommand,
MigrateMakeCommand, RollbackCommand,
StatusCommand, ResetCommand, RefreshCommand
)
application.add(InstallCommand())
application.add(MigrateCommand())
application.add(MigrateMakeCommand())
application.add(RollbackCommand())
application.add(StatusCommand())
application.add(ResetCommand())
application.add(RefreshCommand())
from .commands import ScriptCommand
from .commands import SearchCommand
from .commands import ShellCommand
from .commands import ShowCommand
from .commands import UpdateCommand
from .commands import VersionCommand
from .commands.cache import CacheClearCommand
from .commands.debug import DebugInfoCommand
from .commands.debug import DebugResolveCommand
from .commands.self import SelfUpdateCommand
class Application(BaseApplication):
def __init__(self):
super(Application, self).__init__("Poetry", __version__)
self._poetry = None
self._skip_io_configuration = False
self._formatter = Formatter(True)
self._formatter.add_style("error", "red", options=["bold"])
@property
def poetry(self):
from poetry.poetry import Poetry
if self._poetry is not None:
return self._poetry
self._poetry = Poetry.create(os.getcwd())
from .commands import (
AboutCommand,
CheckCommand,
InitCommand,
InstallCommand,
LockCommand,
PackageCommand,
PublishCommand,
RequireCommand,
SearchCommand,
UpdateCommand
)
from .commands.make import MakeSetupCommand, MakeRequirementsCommand
class Application(BaseApplication):
"""
The console application that handles the commands.
"""
def get_default_commands(self):
default_commands = super(Application, self).get_default_commands()
return default_commands + [
AboutCommand(),
CheckCommand(),
InitCommand(),
InstallCommand(),
LockCommand(),
MakeRequirementsCommand(),
MakeSetupCommand(),
PackageCommand(),
# -*- coding: utf-8 -*-
from cleo import Application
from .version import VERSION
from .commands.listen import ListenCommand
from .commands.cache_clear import CacheClearCommand
app = Application('Melomaniac', VERSION, True)
app.add(ListenCommand())
app.add(CacheClearCommand())
"""
PyStratum
"""
from typing import List
from cleo import Application, Command
from pystratum.command.ConstantsCommand import ConstantsCommand
from pystratum.command.LoaderCommand import LoaderCommand
from pystratum.command.PyStratumCommand import PyStratumCommand
from pystratum.command.WrapperCommand import WrapperCommand
class PyStratumApplication(Application):
"""
The PyStratum application.
"""
# ------------------------------------------------------------------------------------------------------------------
def __init__(self):
"""
Object constructor
"""
Application.__init__(self, 'pystratum', '0.10.22')
# ------------------------------------------------------------------------------------------------------------------
def get_default_commands(self) -> List[Command]:
"""
Returns the default commands of this application.
def init_commands(self):
self.cli = Application(orator_application.get_name(),
orator_application.get_version())
self.cli.add(InstallCommand(self))
self.cli.add(MigrateCommand(self))
self.cli.add(MigrateMakeCommand(self))
self.cli.add(RollbackCommand(self))
self.cli.add(StatusCommand(self))
self.cli.add(ResetCommand(self))
def __init__(self, path=None):
BaseApplication.__init__(self, "Jetty", __version__)
self._path = path
self._poetry = None
self._skip_io_configuration = False
self._formatter = Formatter(True)
self._formatter.add_style("error", "red", options=["bold"])