コード例 #1
0
class CoreInitialiser():
    """Callable class that instantiates the core object."""

    WEB = " -g web "
    NOT_INTERACTIVE = " -i no "

    def __init__(self, target):
        self.target = target

    def __call__(self):
        root_dir = path.abspath("..")  # Relative to tests/ directory
        options = self.WEB + self.NOT_INTERACTIVE + self.target  # Example options to initialise the framework
        self.core_instance = Core(root_dir)
        processed_options = self.process_options(options)
        self.core_instance.initialise_framework(processed_options)
        self.core_instance.PluginHandler.CanPluginRun = lambda arg1, arg2: True
        return self.core_instance

    def process_options(self, options):
        args = shlex.split(options)
        return ProcessOptions(self.core_instance, args)
コード例 #2
0
class CoreInitialiser():
    """Callable class that instantiates the core object."""

    WEB = " -g web "
    NOT_INTERACTIVE = " -i no "

    def __init__(self, target):
        self.target = target

    def __call__(self):
        root_dir = path.abspath("..")  # Relative to tests/ directory
        options = self.WEB + self.NOT_INTERACTIVE + self.target  # Example options to initialise the framework
        self.core_instance = Core(root_dir)
        processed_options = self.process_options(options)
        self.core_instance.initialise_framework(processed_options)
        self.core_instance.PluginHandler.CanPluginRun = lambda arg1, arg2: True
        return self.core_instance

    def process_options(self, options):
        args = shlex.split(options)
        return ProcessOptions(self.core_instance, args)