예제 #1
0
    def setup(self, mock_runtime_config, mock_global_args, mock_command_args,
              mock_load_command, mock_help_check, mock_color, mock_setlog,
              mock_setlevel):
        mock_global_args.return_value = {
            '--debug': True,
            '--logfile': 'log',
            '--color-output': True,
            '--profile': ['vmxFlavour'],
            '--type': None
        }
        mock_command_args.return_value = {
            'system': True,
            'prepare': True,
            '--description': 'description',
            '--root': 'directory'
        }

        self.task = CliTask()

        mock_help_check.assert_called_once_with()
        mock_load_command.assert_called_once_with()
        mock_command_args.assert_called_once_with()
        mock_global_args.assert_called_once_with()
        mock_setlevel.assert_called_once_with(logging.DEBUG)
        mock_setlog.assert_called_once_with('log')
        mock_color.assert_called_once_with()
        mock_runtime_config.assert_called_once_with()
예제 #2
0
    def setup(self, mock_help, mock_color, mock_setlog, mock_setlevel,
              mock_section, mock_isfile):
        sys.argv = [
            sys.argv[0], '--debug', '--logfile', 'log', '--color-output',
            '--profile', 'vmxFlavour', 'system', 'prepare', '--description',
            'description', '--root', 'directory'
        ]
        self.task = CliTask()

        mock_help.assert_called_once_with()
        mock_setlevel.assert_called_once_with(logging.DEBUG)
        mock_setlog.assert_called_once_with('log')
        mock_color.assert_called_once_with()