Beispiel #1
0
def pipeline_config() -> PipelineConfig:
    """Create a fixture for a pipeline configuration with few representatives of each pipeline unit type."""
    flexmock(PipelineConfig)

    flexmock(Boot1)
    flexmock(Pseudonym1)
    flexmock(Sieve1)
    flexmock(Step1)
    flexmock(Stride1)
    flexmock(Wrap1)

    boot1 = Boot1()
    pseudonym1 = Pseudonym1()
    sieve1 = Sieve1()
    step1 = Step1()
    stride1 = Stride1()
    wrap1 = Wrap1()

    return PipelineConfig(
        boots={boot1.configuration.get("package_name"): [boot1]},
        pseudonyms={pseudonym1.configuration["package_name"]: [pseudonym1]},
        sieves={sieve1.configuration.get("package_name"): [sieve1]},
        steps={step1.configuration.get("package_name"): [step1]},
        strides={stride1.configuration.get("package_name"): [stride1]},
        wraps={wrap1.configuration.get("package_name"): [wrap1]},
    )
    def _get_test_dm(
            *,
            stack_output: str,
            with_devel: bool,
            products: List[Product],
            amun_context: Optional[Dict[str, Any]] = None) -> DependencyMonkey:
        """Get instantiated dependency monkey ready to be tested."""
        flexmock(Resolver)
        (Resolver.should_receive("resolve_products").with_args(
            with_devel=with_devel).and_return(products).once())

        flexmock(PipelineConfig)
        (PipelineConfig.should_receive("call_post_run_report").and_return(
            None).once())

        dependency_monkey = DependencyMonkey(
            resolver=Resolver(
                pipeline=PipelineConfig(),
                project=None,
                library_usage=None,
                graph=None,
                predictor=None,
            ),
            stack_output=stack_output,
            decision_type=DecisionType.ALL,
            context=amun_context or {},
        )

        return dependency_monkey
Beispiel #3
0
def pipeline_config() -> PipelineConfig:  # noqa: D401
    """A fixture for a pipeline config."""
    return PipelineConfig(boots={},
                          pseudonyms={},
                          sieves={},
                          steps={},
                          strides={},
                          wraps={})
Beispiel #4
0
def pipeline_config() -> PipelineConfig:
    """A fixture for a pipeline configuration with few representatives of each pipeline unit type."""
    flexmock(PipelineConfig)

    flexmock(Boot1)
    flexmock(Sieve1)
    flexmock(Step1)
    flexmock(Stride1)
    flexmock(Wrap1)

    return PipelineConfig(
        boots=[Boot1()],
        sieves=[Sieve1()],
        steps=[Step1()],
        strides=[Stride1()],
        wraps=[Wrap1()],
    )
Beispiel #5
0
def pipeline_config() -> PipelineConfig:
    """A fixture for a pipeline config."""
    return PipelineConfig(boots=[], sieves=[], steps=[], strides=[], wraps=[])