Пример #1
0
    def test_add_check_task_fake_task(self, m_log):
        FirstTimeRun.add_check_task(self.fake_check_true, True)

        self.assertEqual(0, len(FirstTimeRun._check_tasks))
        m_log.warning.assert_called_once()
Пример #2
0
from radloggerpy import config

from cliff import app
from cliff import commandmanager
from cliff.complete import CompleteCommand

from radloggerpy._i18n import _
from radloggerpy.common import ascii_logo
from radloggerpy.common.first_time_run import FirstTimeRun
from radloggerpy.config.config import parse_args
from radloggerpy.database import database_manager as dm
from radloggerpy import version

CONF = config.CONF

FirstTimeRun.add_check_task(dm.check_database_missing, dm.create_database)


class RadLoggerShell(app.App):
    """RadLoggerPy interactive command line interface"""
    def __init__(self, **kwargs):
        super().__init__(
            description=self.__doc__.strip(),
            version=version.version_string,
            command_manager=commandmanager.CommandManager('radloggerpy.cli'),
            deferred_help=True,
            **kwargs)
        self.command_manager.add_command('complete', CompleteCommand)
        self.database_session = dm.create_session()

    def initialize_app(self, argv):
Пример #3
0
    def test_add_check_task(self):
        FirstTimeRun.add_check_task(self.fake_check_true, self.fake_task)

        self.assertEqual(1, len(FirstTimeRun._check_tasks))