Esempio n. 1
0
def _run(test_options=None):
    version = ver_check()
    options = test_options or docopt(__doc__, version=version)
    packager.set_global_verbosity_level(options.get('--verbose'))
    lgr.debug(options)

    packager.create(config_file=options.get('--config'),
                    force=options.get('--force'),
                    dryrun=options.get('--dryrun'),
                    no_validate=options.get('--no-validation'),
                    verbose=options.get('--verbose'))
def _run(test_options=None):
    version = ver_check()
    options = test_options or docopt(__doc__, version=version)
    packager.set_global_verbosity_level(options.get('--verbose'))
    lgr.debug(options)

    packager.create(
        config_file=options.get('--config'),
        force=options.get('--force'),
        dryrun=options.get('--dryrun'),
        no_validate=options.get('--no-validation'),
        verbose=options.get('--verbose')
        )
    def test_set_global_verbosity_level(self):
        lgr = init(base_level=logging.INFO)

        with LogCapture() as l:
            ap.set_global_verbosity_level(is_verbose_output=False)
            lgr.debug('TEST_LOGGER_OUTPUT')
            l.check()
            lgr.info('TEST_LOGGER_OUTPUT')
            l.check(('user', 'INFO', 'TEST_LOGGER_OUTPUT'))

            ap.set_global_verbosity_level(is_verbose_output=True)
            lgr.debug('TEST_LOGGER_OUTPUT')
            l.check(('user', 'INFO', 'TEST_LOGGER_OUTPUT'),
                    ('user', 'DEBUG', 'TEST_LOGGER_OUTPUT'))
    def test_set_global_verbosity_level(self):
        lgr = init(base_level=logging.INFO)

        with LogCapture() as l:
            ap.set_global_verbosity_level(is_verbose_output=False)
            lgr.debug('TEST_LOGGER_OUTPUT')
            l.check()
            lgr.info('TEST_LOGGER_OUTPUT')
            l.check(('user', 'INFO', 'TEST_LOGGER_OUTPUT'))

            ap.set_global_verbosity_level(is_verbose_output=True)
            lgr.debug('TEST_LOGGER_OUTPUT')
            l.check(
                ('user', 'INFO', 'TEST_LOGGER_OUTPUT'),
                ('user', 'DEBUG', 'TEST_LOGGER_OUTPUT'))