Esempio n. 1
0
def test_generate_config_adds_case_paths(
    sample_id: str,
    mip_dna_analysis_obj: Store.Analysis,
    upload_mip_analysis_scout_api: UploadScoutAPI,
):
    """Test that generate config adds case file paths"""
    # GIVEN a status db and hk with an analysis

    # WHEN generating the scout config for the analysis
    result_data: ScoutLoadConfig = upload_mip_analysis_scout_api.generate_config(
        mip_dna_analysis_obj)

    # THEN the config should contain the multiqc file path
    assert result_data.multiqc
Esempio n. 2
0
def test_generate_balsamic_load_config(
        balsamic_analysis_obj: models.Analysis,
        upload_balsamic_analysis_scout_api: UploadScoutAPI):
    # GIVEN a analysis object that have been run with balsamic
    assert balsamic_analysis_obj.pipeline == Pipeline.BALSAMIC

    # GIVEN a upload scout api with some balsamic information

    # WHEN generating a load config
    config = upload_balsamic_analysis_scout_api.generate_config(
        analysis_obj=balsamic_analysis_obj)

    # THEN assert that the config is a balsamic config
    assert isinstance(config, BalsamicLoadConfig)
Esempio n. 3
0
def test_generate_config_adds_meta_result_key(
    result_key: str,
    mip_dna_analysis_obj: models.Analysis,
    upload_mip_analysis_scout_api: UploadScoutAPI,
):
    """Test that generate config adds the expected result keys"""
    # GIVEN a status db and hk with an analysis
    assert mip_dna_analysis_obj

    # WHEN generating the scout config for the analysis
    result_data: ScoutLoadConfig = upload_mip_analysis_scout_api.generate_config(
        analysis_obj=mip_dna_analysis_obj)

    # THEN the config should contain the rank model version used
    assert result_data.dict()[result_key]
Esempio n. 4
0
def test_generate_config_adds_sample_paths(
    sample_id: str,
    mip_dna_analysis_obj: models.Analysis,
    upload_mip_analysis_scout_api: UploadScoutAPI,
):
    """Test that generate config adds vcf2cytosure file"""
    # GIVEN a status db and hk with an analysis

    # WHEN generating the scout config for the analysis
    result_data: ScoutLoadConfig = upload_mip_analysis_scout_api.generate_config(
        mip_dna_analysis_obj)

    # THEN the config should contain the sample file path for each sample
    sample: ScoutMipIndividual
    for sample in result_data.samples:
        if sample.sample_id == sample_id:
            assert sample.vcf2cytosure