def build(ctx, max_revisions, targets, operators, archiver): """Build the wily cache.""" config = ctx.obj["CONFIG"] from wily.commands.build import build if max_revisions: logger.debug(f"Fixing revisions to {max_revisions}") config.max_revisions = max_revisions if operators: logger.debug(f"Fixing operators to {operators}") config.operators = operators.strip().split(",") if archiver: logger.debug(f"Fixing archiver to {archiver}") config.archiver = archiver if targets: logger.debug(f"Fixing targets to {targets}") config.targets = targets build( config=config, archiver=resolve_archiver(config.archiver), operators=resolve_operators(config.operators), ) logger.info( "Completed building wily history, run `wily report <file>` or `wily index` to see more." )
def test_build_simple(config): _test_operators = (MockOperator,) with patch("wily.state.resolve_archiver", return_value=MockArchiver): result = build.build(config, MockArchiver, _test_operators) assert result is None